Skip to content

Harden npm release publishing - #1

Merged
FlyOverCoderKY merged 6 commits into
mainfrom
claude/secure-npm-releases
Jul 28, 2026
Merged

FlyOverCoderKY merged 6 commits into
mainfrom
claude/secure-npm-releases

Conversation

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor

What changed

  • require a pre-existing approved SSH-signed annotated release tag that matches the package version, the release event commit, and origin/main
  • split release preparation from the minimal OIDC-enabled publish job
  • pin Node 24.18.0, npm 11.18.0, and all GitHub Actions by commit SHA; disable release caching
  • pack and smoke-test one tarball, record exact integrity, and publish only that verified artifact
  • make retries safe by skipping only an existing byte-identical version
  • remove the broad workflow_dispatch path and document external trusted-publisher, environment, signer, and tag-rule configuration

The lockfile workspace version is also corrected from 0.0.0 to the published manifest version 0.1.1; the new validator caught that existing drift.

Validation

Passed on Node 22.18.0 and 24.18.0 with npm 11.18.0:

  • npm run format:check
  • npm run check
  • npm test (22 tests)
  • npm run release:check

Also prepared and clean-consumer smoke-tested the exact tarball on Node 24.18.0.

Copilot AI review requested due to automatic review settings July 27, 2026 22:29
@cursor

cursor Bot commented Jul 27, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown
Contributor Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens @pegma/spine’s npm release process by enforcing a signed, immutable release tag flow and splitting “prepare” (build/pack/verify) from the minimal OIDC-enabled “publish” job so only a pre-verified artifact can be released.

Changes:

  • Adds a Node-based release validator/packager/publisher script and corresponding tests to verify release metadata, tag authenticity, and retry-safe publishing behavior.
  • Updates the publish workflow to (1) verify signed annotated tags and produce a single checked tarball artifact, then (2) publish only that artifact under OIDC in a separate environment-scoped job.
  • Extends test discovery/tsconfig to include tests/**/*.test.ts, and documents the release runbook and required external configuration.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
vitest.config.ts Expands vitest includes to run top-level release/workflow tests.
tsconfig.test.json Ensures TypeScript checking includes the new tests/ suite.
tests/release-packages.test.ts Adds coverage for tag validation, workflow hardening invariants, and retry-safe publish decisions.
scripts/release-packages.mjs Implements release metadata validation, deterministic pack+hash+smoke-test, and publish-from-prepared-artifact.
scripts/release-packages.d.mts Provides TS typings for the release script module.
README.md Links maintainers to the release runbook and documents trusted publishing expectations.
package.json Pins npm version via packageManager and adds release:* scripts.
package-lock.json Synchronizes the workspace entry version with the public package version.
docs/RELEASING.md Introduces a detailed release runbook and required external configuration steps.
AGENTS.md Updates repository workflow guidance to match the hardened tag-based release process.
.gitignore Ignores .release/ artifacts produced by release preparation.
.github/workflows/publish.yml Splits prepare vs publish, pins Node, removes dispatch path, and publishes only a verified artifact with OIDC.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/publish.yml Resolved
Comment thread scripts/release-packages.d.mts Resolved

Copy link
Copy Markdown
Contributor Author

@codex review

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: d04a55d98e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor Author

@codex review

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 3430cf0536

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@FlyOverCoderKY
FlyOverCoderKY merged commit 9fe1c06 into main Jul 28, 2026
4 checks passed
@FlyOverCoderKY
FlyOverCoderKY deleted the claude/secure-npm-releases branch July 28, 2026 00:34
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.

3 participants