General: Use GitHub App for release push instead of default token#566
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
No user-facing behavior change. Switches
release-prepare.yml'spush-and-dispatchjob from the defaultGITHUB_TOKENto a GitHub App token. The App (d4rken-org-releaser) is added as a bypass actor in the repo's main-branch and tag rulesets, so the bump commit and tag push go through without loosening protections for human users.Technical Context
GITHUB_TOKENcan't be added as a bypass actor in the rulesets picker on personal/org repos — only installed GitHub Apps appear there. So the App is what makes the bypass possible cleanly.GITHUB_TOKEN(read-only); only Job 2 mints the App token (only step with side effects).gh api /appand/users/<slug>%5Bbot%5Drather than hardcoding — robust to future App rename.permissions:on Job 2 reduced tocontents: readsince the workflow's GITHUB_TOKEN no longer does any privileged operations.actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 #v3.1.1.Prerequisites (already done by the maintainer)
capodRELEASE_APP_IDandRELEASE_APP_PRIVATE_KEYconfiguredReview checklist
dry_run=truerun (the "Resolve bot identity" step prints the slug + email)dry_run=falseto verify the App token actually allows the push through both rulesets