Prettier ignores prettier_flags when using github-pr-review
paulvanbrenk opened this issue · comments
This is how I configured the action in my workflow file
- uses: EPMatt/reviewdog-action-prettier@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review # add comments in the review
level: warning # [info,warning,error]
prettier_flags: '**/*.{js,ts,tsx,md,json}'
However in the log from the github action I see the following:
And I get suggestions for changes in the yarn.lock file.
Any ideas?
edit: created a repo to show the issue. You can see the errors reported in the logs for the workflow for this PR
Hi @paulvanbrenk,
thank you so much for reporting here.
This behavior is quite strange. Since we pass Prettier flags when the action is configured with github-pr-review
as well, the filtering applied to prettier should have the same effect as with github-check
.
This is the code for the github-pr-review
reporter:
reviewdog-action-prettier/script.sh
Lines 25 to 27 in 02ff785
What happens if you run prettier locally with the same flags? eg. by executing the command from the package root directory: $(npm root)"/.bin/prettier --write **/*.{js,ts,tsx,md,json}
?
Thanks!
What happens if you run prettier locally with the same flags? eg. by executing the command from the package root directory: $(npm root)"/.bin/prettier --write **/*.{js,ts,tsx,md,json} ?
That works as expected.
It also looks like prettier is invoked twice when run with the github-pr-review
reporter
+1