You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Release Tag Creation Fails With 403 When a Workflow-Touching Merge Lands on main Mid-Publish #2001
build-release-task.yml intermittently fails at the GitHub-release step with 403 Resource not accessible by integration, even though the calling job grants contents: write. The trigger is a race between two bot merges to main, which the fleet's dual daily Dependabot schedule produces routinely.
What triggers it
The codegen App merges a uv-deps PR to main (commit A). It touches a shipped path, so publish-release.yml starts.
Seconds later it merges an actions-deps PR to main (commit B), which edits .github/workflows/. That path is not shipped, so no second publish runs.
The publish run reaches softprops/action-gh-release and asks for a new tag at commit A, which is no longer the branch head. A's .github/workflows/ content now differs from main's.
GitHub treats the new ref as introducing workflow-file content, which needs the workflows scope. GITHUB_TOKEN can never hold that scope, so the create call returns 403.
The token grants are identical in the failing and the succeeding runs (Actions: write, Contents: write). The only thing that differs is merge order. In ptr727/aiopurpleair every failing bot release (#135, #148 and #180 merges) had an actions-deps merge land on main right after it. The one success (#156) had its actions-deps merge land before.
Consequence
The failed publish also skips publish-pypi, so the dependency bump never reaches PyPI. Nothing retries, because the follow-up actions-deps push is outside on.push.paths. This is the stale-dependency window the path filter exists to close, and it opens silently apart from a red run.
Possible directions
Create the tag with the codegen App token (which can carry workflows), not GITHUB_TOKEN.
Or have the release gate detect that the triggering SHA is no longer the branch head and release the head instead (still validated), or defer the release.
Or, as a fleet norm, stagger the main-target Dependabot ecosystems so their merges cannot overlap. This is a mitigation, not a fix.
Found while diagnosing ptr727/aiopurpleair's failing release runs.
Activity
Supersede a Release GITHUB_TOKEN Cannot Tag (#2002)
Promote develop to main: Supersede a Release GITHUB_TOKEN Cannot Tag (#…
CI: fix intermittent GitHub API 403s in builds and dev publishing (#6)