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

Failed to merge PR: Resource not accessible by integration #171

Open
lukejgaskell opened this issue Sep 8, 2021 · 7 comments
Open

Failed to merge PR: Resource not accessible by integration #171

lukejgaskell opened this issue Sep 8, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@lukejgaskell
Copy link

lukejgaskell commented Sep 8, 2021

Description

Running into an issue where the action intermittently is unable to merge the pull request. It complains about the resource not being accessible from the integration (Failed to merge PR: Resource not accessible by integration).

Setup

  • Pull Requests are coming from forks, but that shouldn't matter as we are using the pull_request_target event.
  • We run an auto approve step and then an auto merge. The auto merge ends up failing all retries and returns the following.

Has anyone seen this issue? Is there a certain way a pull request could be created from a fork that might cause this?

Logs

Run pascalgn/automerge-action@v0.14.2
2021-09-07T17:49:30.087Z INFO  Event name: pull_request_target
2021-09-07T17:49:30.415Z INFO  Skipping PR update, required label missing: automerge
2021-09-07T17:49:30.416Z INFO  Merging PR #<PR NUMBER>
2021-09-07T17:49:30.416Z INFO  PR is probably ready: mergeable_state: unstable
2021-09-07T17:49:30.650Z INFO  Failed to merge PR: Resource not accessible by integration
2021-09-07T17:49:30.650Z INFO  Retrying after 5000 ms ... (1/6)
2021-09-07T17:49:36.150Z INFO  Failed to merge PR: Resource not accessible by integration
2021-09-07T17:49:36.150Z INFO  Retrying after 5000 ms ... (2/6)
2021-09-07T17:49:41.846Z INFO  Failed to merge PR: Resource not accessible by integration
2021-09-07T17:49:41.846Z INFO  Retrying after 5000 ms ... (3/6)
2021-09-07T17:49:47.330Z INFO  Failed to merge PR: Resource not accessible by integration
2021-09-07T17:49:47.330Z INFO  Retrying after 5000 ms ... (4/6)
2021-09-07T17:49:52.824Z INFO  Failed to merge PR: Resource not accessible by integration
2021-09-07T17:49:52.824Z INFO  Retrying after 5000 ms ... (5/6)
2021-09-07T17:49:58.336Z INFO  Failed to merge PR: Resource not accessible by integration
2021-09-07T17:49:58.336Z INFO  Retrying after 5000 ms ... (6/6)
2021-09-07T17:50:04.029Z INFO  Failed to merge PR: Resource not accessible by integration
2021-09-07T17:50:04.029Z INFO  PR could not be merged after 6 tries
@Anne-Gaelle-S
Copy link

I'm facing the same issue.
Here is my yaml file :

name: automerge check

on:
  pull_request:
    types:
      - labeled
  check_suite:
    types:
      - completed

permissions:
  contents: read
  pull-requests: write

jobs:
  automerge:
    runs-on: ubuntu-latest
    steps:
      - name: automerge
        uses: "pascalgn/automerge-action@v0.8.3"
        env:
          GITHUB_TOKEN: "${{ github.token }}"
          MERGE_LABELS: ":rocket: Ready to Merge"
          MERGE_COMMIT_MESSAGE: "pull-request-title"
          UPDATE_LABELS: ":rocket: Ready to Merge"
          UPDATE_METHOD: "rebase"
          MERGE_FORKS: "false"

It was working fine before I added the permissions part.
Anyone has an idea ?

@LinhaiShen
Copy link

Works for me:
Change the trigger event from pull_request to pull_request_target

@pascalgn pascalgn added the bug Something isn't working label Nov 17, 2021
@totoprayogo1916
Copy link

totoprayogo1916 commented Nov 12, 2022

Have same problem,
Not work on forks?

@mmiranda
Copy link

I had the same issue, it fixes when you use a PAT with permissions to manage PRs

@yiliang114
Copy link

I met this problem and finally found that the GITHUB_TOKEN token does not exist. You can check whether the secrets.GITHUB_TOKEN exists or whether there is an error. @mmiranda @totoprayogo1916

@Abelkrijgtalles
Copy link

I found the solution: Go to the settings of your repo, actions, general. Then change the permission to read and write, and allow it to open and approve pull requests.
image

@jasmeetsinghbhatia
Copy link

I found the solution: Go to the settings of your repo, actions, general. Then change the permission to read and write, and allow it to open and approve pull requests. image

This one particularly did not work for me as I already had the said settings enabled. Still facing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants