Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get the 403 resource not accessible error in a reusable workflow action #147

Open
lindseysimple opened this issue Sep 19, 2022 · 3 comments

Comments

@lindseysimple
Copy link

Define the action-eslint action in a callee reusable workflow as below:

jobs:
  eslint:
    runs-on: ubuntu-latest
    env:
      NODE_VERSION: 16
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: ${{ env.NODE_VERSION }}      
      - name: Install dependencies
        run: npm ci
      - uses: reviewdog/action-eslint@v1
        with:
          fail_on_error: true
          eslint_flags: 'src/'

Will get the following error on the caller workflow:

eslint version:v8.19.0
 Running eslint with reviewdog 🐶 ...
  reviewdog: GET https://api.github.com/repos/<org>/<repo>/pulls/38/comments?per_page=100: 403 Resource not accessible by integration []
Error: Process completed with exit code 1.

If not using the reusable workflow, it works on the repository which triggers the github action.

@zirkelc
Copy link

zirkelc commented Jan 11, 2023

Same issue here. Were you able to solve it?

@zirkelc
Copy link

zirkelc commented Jan 11, 2023

Adding the persmissions on workflow level solved the issue for me:

permissions:
  checks: write
  contents: write
  issues: write
  pull-requests: write

@hlascelles
Copy link

NB Always use least privilege. Don't give any tasks/jobs/people any more permissions than they need.

You should just be able to use:

permissions:
  checks: write
  contents: read
  pull-requests: read

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants