Skip to content

ci: gate v0.x publish with npm-publish environment#10667

Merged
jasonsaayman merged 1 commit into
axios:v0.xfrom
shaanmajid:feat/publish-env-v0x
Apr 7, 2026
Merged

ci: gate v0.x publish with npm-publish environment#10667
jasonsaayman merged 1 commit into
axios:v0.xfrom
shaanmajid:feat/publish-env-v0x

Conversation

@shaanmajid
Copy link
Copy Markdown
Contributor

@shaanmajid shaanmajid commented Apr 7, 2026

Summary

  • Add environment: npm-publish to the v0.x publish workflow

Why

Ensures release publishes pass through GitHub Environment protections (required reviewers, deployment branch restrictions, etc.) before publishing to npm.

⚠️ Note : Environment protections significantly raise the bar for unauthorized publishes but are not a complete defense against a fully compromised admin account. Please reach out if more information is required before merging.

Maintainer setup required

  1. Go to Repository Settings > Environments > New environment, create npm-publish
  2. Configure protection rules (specific settings are up to your preference, but here's what I'd recommend):
    • Required reviewers: add at least two trusted maintainers
    • Prevent self-review: enable, so the person who pushes the release tag cannot approve their own publish
    • Deployment branches and tags: select "Selected branches and tags", then add two Tag rules: v1.*.* and v0.*.*
    • Allow administrators to bypass configured protection rules: disable, otherwise admins can bypass all of the above
  3. On npmjs.com, update the package's trusted publisher config to include npm-publish in the environment field (must match the GitHub environment name exactly)

Related

Companion PR: #10666 (v1.x). Both PRs should be merged together since the npm-publish environment name must be consistent across workflows.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Copy link
Copy Markdown
Member

@jasonsaayman jasonsaayman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice thanks! 🔥

@jasonsaayman jasonsaayman merged commit 68f97f7 into axios:v0.x Apr 7, 2026
12 checks passed
@shaanmajid shaanmajid deleted the feat/publish-env-v0x branch April 7, 2026 19:29
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.

2 participants