action-eslint icon indicating copy to clipboard operation
action-eslint copied to clipboard

reviewdog: This GitHub token doesn't have write permission of Review API [1]

Open Inrixia opened this issue 3 years ago • 1 comments

So I'm following the example provided and everything is working except for the given error above...

 eslint:
  name: eslint
  runs-on: ubuntu-latest
  steps:
   - uses: actions/checkout@v2
   - uses: reviewdog/action-eslint@v1
     with:
      reporter: github-check
      eslint_flags: "src/"

Inrixia avatar Sep 20 '22 01:09 Inrixia

Adding github_token: ${{ secrets.GITHUB_TOKEN }} does nothing

Inrixia avatar Sep 20 '22 01:09 Inrixia

Adding a permission block helped to run reviewdog as expected. Tested with eslint 7 & 8.

eslint:
  name: eslint
    runs-on: ubuntu-latest
+    permissions:
+      contents: read
+      pull-requests: write 
  steps:
   - uses: actions/checkout@v2
   - uses: reviewdog/action-eslint@v1
     with:
+     github_token: ${{ secrets.GITHUB_TOKEN }}
       reporter: github-check
       eslint_flags: "src/"
     

revathskumar avatar Oct 18 '22 18:10 revathskumar

I don't have a open PR to test this.

But assuming this works that's a great fix, thanks, I might create a test repo to verify this fix.

Regardless this info should be added to this repositories readme.

Inrixia avatar Oct 19 '22 11:10 Inrixia