Skip to content

Harden npm package publishing - #42

Merged
yosriady merged 3 commits into
mainfrom
agent/harden-supply-chain
Aug 5, 2026
Merged

Harden npm package publishing#42
yosriady merged 3 commits into
mainfrom
agent/harden-supply-chain

Conversation

@yosriady

@yosriady yosriady commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What changed

  • isolates tests and their secret from the OIDC-enabled npm publish job
  • publishes a validated tarball through a protected npm-publish environment
  • removes the floating npm@latest install and disables publish-job caching
  • adds a seven-day dependency quarantine, trust-downgrade protection, and supply-chain CODEOWNERS coverage
  • disables checkout credential persistence in CI

Why

The release job previously combined repository write access, npm OIDC, dependency execution, and a test secret. The new jobs keep each credential boundary minimal.

Validation

  • frozen install succeeded
  • build and typecheck succeeded
  • 192 tests passed, with one existing pending test
  • package tarball inspection succeeded
  • production audit reported no known vulnerabilities
  • workflow YAML and embedded shell syntax validated

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Review in cubic

@yosriady
yosriady marked this pull request as ready for review August 5, 2026 05:55

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f7bff933ed

ℹ️ 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".

echo "tarball=${TARBALLS[0]}" >> "$GITHUB_ENV"

- name: Publish with OIDC provenance
run: npm publish "$tarball" --provenance --access public

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Prefix the tarball path before npm publish

When the tag workflow reaches this publish step, find package ... stores a value like package/formo-cli-1.2.1.tgz in tarball; passing that unqualified one-slash spec to npm publish is not treated as the downloaded local tarball. npm's package-spec docs show local tarballs as ./my-package.tgz while username/project is GitHub shorthand (https://docs.npmjs.com/cli/v11/using-npm/package-spec/), and npm publish --dry-run package/foo.tgz resolves as a GitHub repo, so releases will fail before publishing. Use ./${TARBALLS[0]} or an absolute path from find.

Useful? React with 👍 / 👎.

Comment thread .github/workflows/release.yml Outdated
name: npm-package
path: ${{ runner.temp }}/package/*.tgz
if-no-files-found: error
retention-days: 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep the package artifact past approval delays

When the npm-publish environment has required reviewers or a wait timer, the publish job can remain pending for more than 24 hours after the build uploaded this tarball; with retention-days: 1, GitHub is allowed to expire the only package candidate before the protected job starts, so download-artifact fails and the validated release cannot be published. Use the repository default or a retention window that comfortably exceeds the expected approval SLA.

Useful? React with 👍 / 👎.

@yosriady

yosriady commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: f7bff933ed

ℹ️ 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".

@yosriady
yosriady merged commit 713c06b into main Aug 5, 2026
9 checks passed
@yosriady
yosriady deleted the agent/harden-supply-chain branch August 5, 2026 07:00
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