GITHUB_TOKEN gets 403 "Resource not accessible by integration" merging a fork PR that the API itself reports as mergeable/clean #207872
Unanswered
KrisTHL181
asked this question in
Actions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Question
💬 Feature/Topic Area
Workflow Configuration
Discussion Details
I run
KrisTHL181/Break-This-Repo— a public repo — with apull_request_target+ scheduled workflow that auto-merges PRs via the REST merge endpoint. It merges dozens of PRs a day without trouble, including fork PRs and PRs of 50,000+ files. One specific PR (#517) has now failed on every attempt for hours with:The call is:
The puzzling part: at the same moment this returns 403,
GET /repos/KrisTHL181/Break-This-Repo/pulls/517reports"mergeable": true, "mergeable_state": "clean", and the web UI shows a normal, working merge button. So GitHub agrees the PR can be merged — it just refuses this token.The PR:
main), cross-repository: yes;maintainer_can_modify: trueAlready ruled out (each tested, not assumed):
/branches/main/protection→ 404,/rulesets→[]permissions:, successfully merges other PRs in the same runmergeable_stateisclean; the code checksmergeable == CONFLICTINGon a separate pathworkflows: write" explanation (the one GitHub Support describes): I reproduced that exact shape four ways — same-repo head, genuine fork head, fork-default-branch head, and a 6,500-file fork PR — and all four merged fine. So it does not explain this. (workflowsalso isn't an accepted key of thepermissions:block, soGITHUB_TOKENcan't be granted it regardless.)Questions:
PUT /pulls/{n}/mergeanswer403 Resource not accessible by integrationfor a PR that reads asmergeable/clean?GITHUB_TOKEN(rather than a PAT or GitHub App installation token)?For what it's worth, the only thing I've ever seen clear it is pushing a new commit to the head branch — but that's from a single observation, so I can't claim it's causal.
All reactions