How do I fix the “Resource not accessible by integration” error when my workflow tried to push back to the repo #163458
-
Why are you starting this discussion?Question What GitHub Actions topic or product is this about?Misc Discussion DetailsRight after I opened my project to the public, my GitHub Actions workflow started failing on the step that commits and pushes generated docs. The log shows Resource not accessible by integration. What changes did I make so the workflow could push to the repo again? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
The steps below should help you fix this:
''' After those tweaks the push step succeeded on the next run, and my auto‑generated docs land in gh-pages without manual intervention. Hope this helps anyone else who hits the same wall! |
Beta Was this translation helpful? Give feedback.
The steps below should help you fix this:
Gave the workflow explicit write access. In the YAML I added:
'''
permissions:
contents: write
'''
This grants the default GITHUB_TOKEN the rights it needs to push.
Checked the repo‑wide default. Under Settings → Actions → General → Workflow permissions I flipped the radio button to Read and write permissions so new workflows inherit the correct scope.
Purged the stale token cache. I re‑ran the job from scratch (Run workflow → branch → “Re‑run all jobs”) to make sure the freshly scoped token was used.
(Fallback) Used a PAT when I needed cross‑repo pushes. For a separate automation that writes to another repo, I created a fine‑scoped Person…