ci(release): gate publishing behind an approval environment - #56
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Adds
environment: npm-publishto the release job, so a human must approve the run in the Actions UI before it can publish.Why
Now that the repo is public and publishing uses OIDC, there is no stored npm credential — which is good for secret hygiene, but it means a push to
maincan reach the registry on its own. "Who can push tomain" had become "who can publish@intentface/chat".Two controls close that, and this PR is the second half:
main(already applied, no code): requires a PR, requiresverifyto pass, blocks force-pushes and deletion.The environment
Configured outside this PR, via the API:
npm-publishrpvilo(self-review permitted, since it's a single reviewer)mainonlyEffect: the release job sits in "Waiting" until approved. It's the same proof-of-presence property as npm's staged publishing, but it works today —
npm stageneeds CLI 11.15.0 and we're on 11.13.0.Worth knowing
The gate covers the whole job, not just the publish step. So when the workflow is only opening or updating a Version Packages PR, it also waits for approval. That's one extra click per release cycle, which seemed a fair trade rather than splitting the job in two to distinguish the cases.
Optional tightening, not done here: npm's trusted publisher config accepts an environment name. Setting it to
npm-publishwhen you configure the trusted publisher would make npm itself reject an OIDC token minted outside this environment, rather than relying only on GitHub to enforce it.Verified
Workflow YAML parses;
environment,permissionsand triggers are unchanged apart from the addition. No package code touched, so no changeset.