Skip to content

ci: pin publish workflow actions, read-only token, reject non-version release tags - #641

Open
julianrubino wants to merge 1 commit into
developfrom
ci/publish-npm-pins
Open

julianrubino wants to merge 1 commit into
developfrom
ci/publish-npm-pins

Conversation

@julianrubino

Copy link
Copy Markdown
Member

What

publish-npm.yaml (runs on release: published with NPM_TOKEN):

  • Top-level permissions: contents: read. The job only checks out and publishes to npm; today it runs with the org default token, which is write on everything.
  • Actions pinned to commit SHAs, each the commit the current tag resolves to today: actions/checkout a37ce9120846195fa4ece8f58b268e6043cb2f26 (v3), actions/setup-node 49933ea5288caeca8642d1e84afbd3f7d6820020 (v4), foundry-rs/foundry-toolchain dba66c27052e63476d886f22216e119ba7e615bf (v1).
  • "Determine NPM Tag" fails unless the part of the tag after refs/tags/v is only letters, digits, ., + and -.

Why

Part of the zeta-chain GitHub Actions hardening. The npm dist-tag comes from the release tag name and is pasted into the yarn publish script through ${{ steps.determine-npm-tag.outputs.NPM_TAG }}, in the same step as NODE_AUTH_TOKEN. Git allows $, (, ) and ; in tag names, so a release published on a tag like v1.0.0-$(...) would run that text as shell with the npm token in the environment. Checking the tag in the step that builds the value closes that without touching the publish line, which #610 also edits (--access public), so the two PRs don't conflict.

A tag can be moved to different code; a commit SHA cannot.

Tags that already publish keep working: v15.0.0 gives latest, v15.0.0-rc1 gives rc1, as before. A tag without the v prefix now fails at this step instead of reaching yarn publish with refs/tags/... as the version.

How Has This Been Tested?

Not run: the workflow only triggers on a published release (the latest are v15.0.0 and v14.1.0, both 2025-10-24; their runs are past retention), and this PR doesn't trigger it. The first proof is the next release: the job log should show the three actions downloaded by SHA, the token block with Contents: read and Metadata: read only, and the publish step as before. A wrong SHA would fail at "Set up job" before any secret is read.

@julianrubino julianrubino added the CI label Dec 4, 2026
@julianrubino

Copy link
Copy Markdown
Member Author

@codex review

@julianrubino

Copy link
Copy Markdown
Member Author

bugbot run

@cursor

cursor Bot commented Dec 4, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-04T09:33:14.128605Z 761a3c8 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 761a3c83ce

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

@julianrubino
julianrubino marked this pull request as ready for review December 4, 2026 09:31
@julianrubino
julianrubino requested review from a team as code owners December 4, 2026 09:31
@julianrubino
julianrubino requested a review from morde08 December 4, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant