Skip to content

Share Linux build deps via artifact, not cache#310

Merged
dwoz merged 1 commit into
mainfrom
fix-auto-release-cache
Jul 1, 2026
Merged

Share Linux build deps via artifact, not cache#310
dwoz merged 1 commit into
mainfrom
fix-auto-release-cache

Conversation

@dwoz

@dwoz dwoz commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

The Auto-Release workflow fires on pull_request: closed and its head ref is the (now-deleted) PR source branch — auto-merge.yml uses gh pr merge --delete-branch. GitHub Actions scopes cache writes to the workflow's head ref; with the ref already deleted by the time Auto-Release starts, the runtime token has no writable scopes and the save fails with:

Cache reservation failed: cache write denied: token has no writable scopes
Failed to save: Unable to reserve cache with key <run_id>-dependencies

The downstream build_linux jobs then hit "Cache not found" during restore, tree $RELENV_DATA/download errors out, and every Linux entry fails. That's what killed the 0.22.17 release run (28422611083). The same run on pr.yml's push-to-main path (28422611021) worked because main is a real ref with a valid cache scope.

Artifacts are scoped to the run_id, not a branch ref, so branch deletion doesn't affect them. Swap the actions/cache pair for actions/upload-artifact + actions/download-artifact:

  • retention-days: 1 keeps the artifact tiny in storage
  • if-no-files-found: error catches the case where --download-only silently produced nothing

Behaviour is identical for the pr.yml path (both cache and artifact work there); the Auto-Release path stops failing.

The Auto-Release workflow fires on pull_request: closed and its head
ref is the (now-deleted) PR source branch — auto-merge.yml uses
`gh pr merge --delete-branch`.  GitHub Actions scopes cache writes to
the workflow's head ref; with the ref already deleted by the time
Auto-Release starts, the runtime token has no writable scopes and the
save fails with:

    Cache reservation failed: cache write denied: token has no writable scopes
    Failed to save: Unable to reserve cache with key <run_id>-dependencies

The downstream build_linux jobs then hit "Cache not found" during
restore, tree $RELENV_DATA/download errors out, and every Linux entry
fails.  That's what killed the 0.22.17 release run (28422611083).  The
same run on pr.yml's push-to-main path (28422611021) worked because
main is a real ref with a valid cache scope.

Artifacts are scoped to the run_id, not a branch ref, so branch
deletion doesn't affect them.  Swap the actions/cache pair for
actions/upload-artifact + actions/download-artifact:

  - retention-days: 1 keeps the artifact tiny in storage
  - if-no-files-found: error catches the case where --download-only
    silently produced nothing

Behaviour is identical for the pr.yml path (both cache and artifact
work there); the Auto-Release path stops failing.
@dwoz dwoz merged commit eff2980 into main Jul 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant