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

Resource not accessible by integration #2672

Open
4 tasks
leonard-henriquez opened this issue Dec 4, 2023 · 7 comments
Open
4 tasks

Resource not accessible by integration #2672

leonard-henriquez opened this issue Dec 4, 2023 · 7 comments

Comments

@leonard-henriquez
Copy link

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

  • 1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox

    Make sure to fork this template and run pnpm generate in the terminal.

    Please make sure the Codegen and plugins version under package.json matches yours.

  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

When we run the github action we get the error: "Resource not accessible by integration"
Screenshot 2023_12_05_000213

To Reproduce Steps to reproduce the behavior:

Our .github/workflows/continuous_integration.yml

name: continuous_integration
on:
  push:
    branches:
      - main
      - staging

permissions:
  id-token: write   # This is required for requesting the JWT
  contents: read    # This is required for actions/checkout

jobs:
  breaking_changes_graphql:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          ref: ${{ github.event.pull_request.head.sha }}

      - name: Install dependencies
        uses: ./.github/actions/pnpm-install-action

      - uses: kamilkisiela/graphql-inspector@master
        with:
          schema: 'main:schema.graphql'

Expected behavior

I would expect the github action to finish with a report

Environment:

  • OS: ubuntu
  • graphql-inspector@master

Additional context

@leonard-henriquez
Copy link
Author

@kamilkisiela is this repo still under active maintenance ?

@kamilkisiela
Copy link
Owner

Yes

@leonard-henriquez
Copy link
Author

Awesome !
@kamilkisiela Do you have any idea what this error mean?
I can't find this message in this codebase.
I have no clue how to debug this error...

@leonard-henriquez
Copy link
Author

It works when I add all permissions.
Any ideas what are the ones needed ?
Screenshot 2023_12_13_000239

@ljukas
Copy link

ljukas commented Dec 15, 2023

image
Mine looks like this and gets the same error. I have set check to write as the docs say here:
image

Will have to go through and enable each one to see which stops this from working

@billdybas
Copy link

I think you also need the pull-requests: read permission. I ran into the same issue & traced it back to getAssociatedPullRequest failing.

const pullRequest = await getAssociatedPullRequest(octokit, commitSha);

It makes an API call to GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls which requires read permissions on pull requests.

@glg-satish-tripathi
Copy link

glg-satish-tripathi commented Jun 7, 2024

@leonard-henriquez After thorough investigation, I discovered that this is the bare minimum permission required for the action to run.

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

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

5 participants