Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 3
Message 1 of 3

GitHub action: Resource not accessible by integration

Solved! Go to Solution.

We have a GitHub action (https://github.com/pascalgn/automerge-action) which automatically merges PRs when they're ready. This was all working fine, but for about 2 days we are now getting "Resource not accessible by integration" when the action is trying to merge the PR.

 

The error occurs when calling https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button

 

Any ideas?

2 Replies
Copilot Lvl 3
Message 2 of 3

Re: GitHub action: Resource not accessible by integration

It looks to be working again. Without any changes on our side, the action now runs successfully again. I am guessing there were some hiccups in the actions permission handling, as it's still in beta.

 

We had a look again and it very much looks like GitHub is actively blocking the action from executing the merge when the PR contains changes of the main.workflow file. We tested this by creating a PR which changes the main.workflow file and we got the "Resource not accessible by integration" error again. When changing the PR so that the workflow file is no longer changed, it gets merged without any problems.

 

(By the way, this same also happens when using the git CLI from within an action. A git push when using the action token for authentication is rejected when it contains changes of the main.workflow file, git push will exit with code 1)

 

We could not find any hints about this in the documentation, maybe someone from GitHub support can confirm these findings?

Solution
Copilot Lvl 3
Message 3 of 3

Re: GitHub action: Resource not accessible by integration

Not sure why they did not reply in this thread, but I did get a confirmation from GitHub support via mail:

 

OAuth tokens and GitHub Apps are restricted from editing the main.workflow file. This means it isn't possible to merge a Pull Request via an Action if it updates the main.workflow file I'm afraid.

This is expected behaviour currently but we'll pass your feedback onto the team to consider.