Closed Ridermansb closed 1 year ago
This error also happens for PRs created by dependabot. Based on issue created by GitHub bot this, it seems that checks: write
is required.
I couldn't find anything related to granting custom permissions for dependabot for the repo:
Please let me know if you find a solution for dependabot, but currently i used following workaround to disable it for dependabot PRs:
- name: Annotate Code Linting Results
uses: ataylorme/eslint-annotate-action@v2
+ if: ${{ github.actor != 'dependabot[bot]' }} # dependabot doesn't have permissions
@atsu85 @Ridermansb this is a permission error with GITHUB_TOKEN
when running from pull request from forks.
GITHUB_TOKEN
for pull requests from forks is limited to read access and the Action requires write
to status checks to do the annotations
For security reasons I would not encourage trying to bypass this. You might be able to use the github
context to determine if a PR is from a fork and skip the annotation step with if
as @atsu85 has shown an example of
You could still have the ESLint step prior run and fail if there are linting errors, there just won't be annotation
Gettings this error
running
eslint --ext .ts,.tsx --output-file eslint_report.json --format json .
with this GH action