Push Homebrew tap via scoped deploy key instead of personal PAT - #102
Merged
Merged
Conversation
The release job checked out exploreomni/homebrew-tap with HOMEBREW_TAP_GITHUB_TOKEN, a classic PAT on a personal account created 2026-04-14 and never rotated. Despite the cosmetic `git config user.name "github-actions[bot]"`, every push event on the tap is authenticated as that human, and the PAT's scope spans every repo the account can write to. Swap it for an ed25519 deploy key scoped to the tap alone. This lets a ruleset on homebrew-tap require PRs for all actors while allowing the deploy key to bypass, so the release workflow remains the only thing that can write to main. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Step 1 done |
dspangen
approved these changes
Sep 21, 2026
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.
Why
The release job checks out
exploreomni/homebrew-tapusingsecrets.HOMEBREW_TAP_GITHUB_TOKEN.That secret is a classic PAT on a personal account, created
2026-04-14and never rotated since. Thegit config user.name "github-actions[bot]"in the publish step is cosmetic — it only labels the commit author. EveryPushEventon the tap reportsactor=ernestoongaro, and a classic PAT carries write access to every repo that account can reach, not just the tap.homebrew-tapalso had no branch protection and no rulesets at all, somainwas open to direct pushes.What changed
actions/checkoutnow authenticates withssh-keybacked by a newHOMEBREW_TAP_DEPLOY_KEYsecret, instead oftoken. A deploy key is scoped to a single repository and is tied to no human account.Rollout order
This PR must land after the deploy key exists, or the next release cannot push the formula.
protect-mainruleset onhomebrew-tap(id23698348) fromevaluatetoactive.HOMEBREW_TAP_GITHUB_TOKENon the personal account and delete the now-unused secret from this repo.The ruleset is currently in
evaluatemode, so it records violations without blocking. Nothing breaks until step 4.