Skip to content

ci(release): gate publishing behind an approval environment - #56

Merged
rpvilo merged 1 commit into
mainfrom
feature/gate-publish-environment
Aug 3, 2026
Merged

ci(release): gate publishing behind an approval environment#56
rpvilo merged 1 commit into
mainfrom
feature/gate-publish-environment

Conversation

@rpvilo

@rpvilo rpvilo commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Adds environment: npm-publish to 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 main can reach the registry on its own. "Who can push to main" had become "who can publish @intentface/chat".

Two controls close that, and this PR is the second half:

  1. A ruleset on main (already applied, no code): requires a PR, requires verify to pass, blocks force-pushes and deletion.
  2. This — an approval gate immediately before the publish job runs.

The environment

Configured outside this PR, via the API:

  • Name: npm-publish
  • Required reviewer: rpvilo (self-review permitted, since it's a single reviewer)
  • Branch policy: main only

Effect: 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 stage needs 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-publish when 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, permissions and triggers are unchanged apart from the addition. No package code touched, so no changeset.

@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
intentface-chat Ready Ready Preview Aug 3, 2026 8:06pm

Request Review

@rpvilo
rpvilo merged commit 9e4972d into main Aug 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant