A workflow step that pushes a version bump fails with `remote: Permission to org/repo.git denied to github-actions[bot].` and `The requested URL returned error: 403`.
IntermediateTroubleshootingGitHub, Actions and Pull Request Issues
Answer
Likely causes → The GITHUB_TOKEN is read-only. Since 2023 new repos and orgs default workflow permissions to "Read repository contents", and the workflow does not request contents: write. A branch ruleset may also block the bot from pushing to main.
Diagnose → Check Settings → Actions → General → Workflow permissions, the permissions: block in the workflow, and the branch's rulesets.
Fix →
permissions:
contents: write
jobs:
release:
steps:
- uses: actions/checkout@v4
- run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -am "chore: bump version" && git push
If main is protected, add the GitHub App used for releases to the ruleset bypass list rather than opening protection for everyone.
Prevent → Declare least-privilege permissions: per job explicitly.
More on GitHub, Actions and Pull Request Issues
A workflow pushes a commit or tag, but the workflow that should run on that push or tag never starts.IntermediateA container job fails on any Git command with `fatal: detected dubious ownership in repository at '/__w/app/app'`.IntermediateYour PR suddenly shows 340 changed files and dozens of commits you did not write.IntermediateThe PR is stuck on `Expected — Waiting for status to be reported` for a required check called `build`.IntermediateThe PR was approved, but merging shows "Review required" again after you pushed a small fix.BeginnerCODEOWNERS is committed, but GitHub does not request reviews from the listed team.Intermediate