feat(release): refuse to publish until GitHub enforces the release protections
Merged
TH
2mo ago+167+167+012345678901234567890123456789-2-2-0123456789
Summary
npm trusts every release.yml run that reaches the npm-publish environment, and the plan a run executes is that run's own copy, so it can't protect anything by itself. Before a nightly or stable publish, the plan now reads the repository's settings through the public API. It refuses, and names each gap, unless all of these hold. Only a 404 counts as "not configured"; any other API error fails the plan.
npm-publishdeploys only from the branchmainand the tag patternv*- the
releaseenvironment requires a reviewer - an active tag ruleset restricts creating, updating, and deleting every
refs/tags/v*tag, with no exclusions and, where GitHub shows its bypass list, only admin bypass
This makes merging the stack before the one-time setup safe: the release workflow fails until the setup is done. #3381 documents the setup. 2 files.
Validation
At ae04bddfd3:
release-plan.test.tspasses 29/29 (with the stacked tests). Each protection gap is named on its own.- Fallow, lint, and format pass.
- Run read-only against today's repo, the check refuses with all three gaps.