-
-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
Hi, I'm struggling a bit to get this working on changed files only (to keep it fast). My action looks like this:
name: reviewdog
on: [pull_request]
jobs:
reviewdog:
name: runner
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- id: files
uses: Ana06/[email protected]
- name: Get changed JS files
run: |
matching_files=()
for changed_file in ${{ steps.files.outputs.added_modified }}; do
if [[ "$changed_file" =~ \.(js|jsx|ts|tsx)$ ]]; then
matching_files+=("$changed_file")
fi
done
# Set env var to be used in next step
echo "CHANGED_JS_FILES=${matching_files[@]}" >> $GITHUB_ENV
- run: |
# If I run this line, it does show the eslint errors I expect
# npx --no-install -c "eslint ${{ env.CHANGED_JS_FILES }}"
- uses: reviewdog/action-eslint@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
level: error
eslint_flags: "${{ env.CHANGED_JS_FILES }}"As mentioned in the code above, if I uncomment the step that does: npx --no-install -c "eslint ${{ env.CHANGED_JS_FILES }}" it correctly shows eslint errors in stdout, but when running through the next step, it provides no output, no errors and there are no review comments.
I know it's not a permissions issue, since I have another action for reviewdog-shellcheck using the same token, and that one works perfectly fine.
Any clue what I'm doing wrong here?
jonsoku-dev, sergio-lucas, houserx-jmcc and JellyBrick
Metadata
Metadata
Assignees
Labels
No labels