Skip to content

Release Tag Creation Fails With 403 When a Workflow-Touching Merge Lands on main Mid-Publish #2001

Closed

Description

@ptr727

Summary

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

  1. The codegen App merges a uv-deps PR to main (commit A). It touches a shipped path, so publish-release.yml starts.
  2. 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.
  3. 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.
  4. 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

  1. added a commit that references this issue on Sep 28, 2026
    9fbdbad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions