Two concurrent workflow runs both try to push a changelog commit; one fails with `! [rejected] main -> main (fetch first)`.
AdvancedTroubleshootingGitHub, Actions and Pull Request Issues
Answer
Likely causes → Runs triggered close together each checked out an older main, committed, and raced to push. The loser's commit is based on a stale parent.
Diagnose → Compare run start times in the Actions tab and git log origin/main -3 after the failure.
Fix → Serialize the jobs and retry with rebase:
concurrency:
group: release-main
cancel-in-progress: false
steps:
- run: |
for i in 1 2 3; do
git pull --rebase origin main && git push origin HEAD:main && break
sleep $((i * 5))
done
Prevent → Avoid bots committing to main for every merge; generate changelogs at release time, or have a single release workflow guarded by a concurrency group.
More on GitHub, Actions and Pull Request Issues
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`.IntermediateA 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.Beginner