fix(ci): preflight release credentials and recover from an orphan tag #2
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/ci-credential-preflight"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What & why
servuo-pluginshit two defects on its first real release run (servuo-plugins#8 has the full post-mortem). This repo runs the same engine, so both are latent here. Fixing them before this repo ever cuts a release.Also fixes this repo's own
sync-project-treefailure onmain, which had the same root cause.What happened over there
REGISTRY_USER/REGISTRY_TOKENwere empty, yet the tag push succeeded —actions/checkoutleaves anhttp.<host>.extraheadercredential in the local git config, sogit remote set-urlto a URL with empty credentials still authenticated through that leftover header. The release API call had no such fallback and returned401. The run got exactly far enough to do the one thing that's hard to undo: repo tagged, no release, failed job.And it couldn't self-heal — any existing tag was read as "nothing to release", so every later run would see the tag, stand down, and the release would never appear.
The fixes
1. Credential preflight, before anything is built or pushed, gated on the run actually intending to publish — so a
docs:/chore:-only merge, or this repo's current pre-crate no-op, still passes green on a repo with no secrets. Names the missing secrets and the scope they need instead of failing wherever they happen to be used first.2. Orphan-tag recovery in the plan step:
200404The
404branch deliberately overrides theRELEASE=falsethe bump logic just decided; with the tag in place there are no releasable commits after it, which is exactly why the state was unrecoverable.Supporting changes: the tag step reuses an existing tag instead of failing on
git tag, and a recovery run's changelog summarizes what the tag contains (previous-tag..this-tag) rather than the empty range after it.3. The same preflight in
sync-project-tree.yml. Its first run onmainfailed with an opaquegit cloneerror againsthttps://:@host/...that said nothing about a missing secret.How it was tested
Extracted every
run:block from all three workflows; all parse underbash -n. Then exercised the paths:Cargo.toml(this repo today) → guard still short-circuits torelease=false, exit 0. The preflight does not fire, so a secretless repo stays green.v0.1.0, unchanged.RunicGateway/link's realv0.3.0(200from the API) → stands down.v0.1.0(404) → recovers.Still needed on this repo
REGISTRY_USER/REGISTRY_TOKEN(Settings → Actions → Secrets) —write:repositoryhere, plus read/write onRunicGateway/docsfor the tree sync. Until they're set,sync-project-treewill now fail with a message that says so, rather than a clone error.Checklist
AI-assisted contributions (required)
Claude Code (Claude Opus 5). Every change has been reviewed and is understood. AI-authored commits are marked with aCo-Authored-Bytrailer.License