fix(ci): probe the dispatch token against both target repos, not just the tap - #415
Merged
Merged
Conversation
… the tap The two dispatch steps in the publish job share one secret, HOMEBREW_TAP_TOKEN, but target different repos: nself-org/homebrew-nself and nself-org/admin. The preflight probe only checked homebrew-nself. So a PAT scoped to the tap but not to admin passed the gate, fired the tap dispatch, and then failed on the admin dispatch — after the release had already published. The gate reported the token as good while half of what it authorises was unusable. The probe now checks every repo it dispatches to and names the failing one in the warning. Whoever mints the replacement PAT needs repo scope on BOTH repos; this proves it before either dispatch runs rather than after one has. Verified by simulation: both-200 passes; the current both-401 state fails; and the tap-only PAT case (200 on homebrew-nself, 404 on admin) — the gap this closes — now fails instead of half-succeeding. Context: the admin side of that dispatch had no listener at all until nself-org/admin#104. HOMEBREW_TAP_TOKEN itself is still expired (HTTP 401) and needs an owner to mint a new one.
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.
The two dispatch steps in the publish job share one secret,
HOMEBREW_TAP_TOKEN, but target different repos:The preflight probe only checked
nself-org/homebrew-nself.So a PAT scoped to the tap but not to admin passes the gate, fires the tap dispatch, then fails on the admin dispatch — after the release has already published. The gate reports the token as good while half of what it authorises is unusable.
Change
The probe now loops over every repo it dispatches to and names the failing one in the warning. Whoever mints the replacement PAT needs
reposcope on both repos; this proves it before either dispatch runs rather than after one has.Verification
Simulated:
tap_token_ok=truetap_token_ok=falsetap_token_ok=false— previously would have half-succeededPer-repo probe results are echoed to the log, so a partial-scope token is diagnosable at a glance.
Context
cli-releasewent into the void on every release, which is why Docker Hub sits at 1.0.13 while CLI is at 1.3.6.HOMEBREW_TAP_TOKENis still expired (HTTP 401 on the v1.3.6 run) and needs an owner to mint a replacement. This PR does not change that; it makes the eventual rotation verifiable.No behaviour change while the token stays expired — the gate already fails closed, and the release itself is unaffected either way.