Skip to content

[r3.4] ci: use App token for build-release and In-case-of-failure rollback#20165

Merged
yperbasis merged 2 commits into
release/3.4from
feature/lystopad/fix-app-token-release-3.4
Mar 26, 2026
Merged

[r3.4] ci: use App token for build-release and In-case-of-failure rollback#20165
yperbasis merged 2 commits into
release/3.4from
feature/lystopad/fix-app-token-release-3.4

Conversation

@lystopad

Copy link
Copy Markdown
Member

Cherry-pick of #20157 and #20162 to release/3.4.

Summary

Both fixes require RELEASE_BOT App to have Workflows: Write permission (already granted).

Co-Authored-By: Claude

…h with workflows scope (#20157)

## Summary

When a release is triggered from a commit that touches
`.github/workflows/` files, GitHub requires the `workflows` scope to
push the git tag. `GITHUB_TOKEN` does not have this scope, causing the
tag push to fail:

> `! [remote rejected] v3.3.10 -> v3.3.10 (Unable to determine if
workflow can be created or updated due to timeout; workflows scope may
be required.)`

Real-world failure:
https://github.com/erigontech/erigon/actions/runs/23549095701/job/68557718510

## Fix

Generate the GitHub App token (already used in `publish-release`) in the
`build-release` job too, and pass it to `actions/checkout`. Since
checkout stores the token as an HTTP `extraheader` in `.git/config`, all
subsequent `git push` calls in that job use the App token instead of
`GITHUB_TOKEN`.

The tag push step runs immediately after checkout (~30s window), well
within the App token's 1-hour expiry.

## Notes

- Same fix needs to be cherry-picked to `release/3.4` and `release/3.3`
- Releases from non-workflow commits are unaffected (latent bug that
only surfaces when workflow files are part of the release HEAD commit)
The rollback job deletes the release git tag when the pipeline fails
mid-way. Previously it used the implicit GITHUB_TOKEN which lacks the
`workflows` scope — so tag deletion would fail with "workflows scope
may be required" if the tag pointed to a workflow-touching commit.

Apply the same App token pattern as build-release: generate a token via
RELEASE_BOT before checkout so that git push -d uses the App's
credentials, which carry Workflows:Write permission.

Co-Authored-By: Claude
@lystopad lystopad requested a review from yperbasis March 25, 2026 21:33
@lystopad lystopad self-assigned this Mar 25, 2026
@yperbasis yperbasis merged commit 74be770 into release/3.4 Mar 26, 2026
20 of 22 checks passed
@yperbasis yperbasis deleted the feature/lystopad/fix-app-token-release-3.4 branch March 26, 2026 08:53
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.

2 participants