Skip to content

Harden npm release publishing - #1

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

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

Conversation

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor

Summary

  • authenticate releases from pre-existing signed annotated tags on origin/main
  • split unprivileged build/test/pack preparation from the minimal OIDC publish job
  • record and re-verify the exact tarball integrity with retry-safe registry handling
  • pin Actions, Node 24.18.0, and npm 11.18.0; remove manual/token fallback paths
  • add a release runbook, CodeQL, and regression tests
  • correct stale documentation: @pegma/audit@0.1.0 is already on npm

Validation

  • Node 22.18.0: npm ci, npm run format:check, npm run check, npm test, npm run release:check
  • Node 24.18.0: same complete gate
  • Node 24.18.0: release pack, integrity manifest, and clean-consumer smoke test
  • changed-file control-byte scan and git diff --check

External npm/GitHub publisher, environment, signer-variable, and tag-ruleset settings are documented but intentionally not mutated.

Copilot AI review requested due to automatic review settings July 27, 2026 22:51
@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

@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.

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/audit’s npm publishing by moving to a signed-annotated-tag release flow, separating preparation from the minimal OIDC-enabled publish job, and adding verification/regression coverage so release artifacts are reproducible and retry-safe.

Changes:

  • Add a release preparation/publish script (scripts/release-packages.mjs) with strict repository/tag validation and tarball integrity verification.
  • Refactor the Publish workflow into unprivileged “prepare” + OIDC-scoped “publish” jobs, and add CodeQL scanning.
  • Expand test/TS configs to include root-level release tests, plus release operations documentation updates.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
vitest.config.ts Expands Vitest discovery to include root tests/**/*.test.ts.
tsconfig.test.json Includes root test files in TypeScript test compilation.
tests/release-packages.test.ts Adds regression tests for release metadata validation, tag authentication, and retry-safe publication decisions.
scripts/release-packages.mjs Implements validated “check/pack/publish” release pipeline with tarball hashing and registry integrity checks.
scripts/release-packages.d.mts Adds TypeScript declarations for the release script exports.
README.md Updates published-status wording and links to the release runbook.
package.json Pins packageManager and adds release:* scripts.
docs/RELEASING.md Adds a signed-tag + trusted publishing release operations runbook.
docs/PROJECT_PLAN.md Updates plan/status to reflect 0.1.0 already published and future trusted publishing.
AGENTS.md Updates agent guidance to match the signed-tag trusted-publisher release procedure.
.gitignore Ignores .release/ artifacts generated by release preparation.
.github/workflows/publish.yml Splits prepare vs publish jobs; enforces signed tag + artifact-based publish with minimal OIDC surface area.
.github/workflows/codeql.yml Adds CodeQL workflow for JS/TS analysis.

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

Comment thread tests/release-packages.test.ts Resolved
Comment thread scripts/release-packages.d.mts Resolved
Comment thread .github/workflows/publish.yml Resolved
Comment thread .github/workflows/codeql.yml Resolved

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. Delightful!

Reviewed commit: 68cd7f58b8

ℹ️ 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 40f9780 into main Jul 28, 2026
4 checks passed
@FlyOverCoderKY
FlyOverCoderKY deleted the claude/secure-npm-releases branch July 28, 2026 00:35
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