Skip to content

ci: use npm OIDC trusted publishing instead of a publish token#2

Merged
khaliqgant merged 1 commit into
mainfrom
chore/oidc-trusted-publishing
Jul 18, 2026
Merged

ci: use npm OIDC trusted publishing instead of a publish token#2
khaliqgant merged 1 commit into
mainfrom
chore/oidc-trusted-publishing

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Jul 18, 2026

Copy link
Copy Markdown
Member

Aligns this repo's publish workflow with the house standard used by relayfile, relaycron, and relayflows: tokenless OIDC trusted publishing. Publish-config only — no runtime code touched.

Changes

  • Removed NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} from the publish step
  • Removed the "Require NPM_TOKEN" guard step (it guards a secret that no longer exists)
  • Added npm install -g npm@11 — OIDC trusted publishing requires npm ≥ 11.5.1
  • Aligned the dry-run invocation with the references (--dry-run --access public --tag <input> --ignore-scripts)
  • README now documents trusted-publisher setup and provenance instead of the token flow

Unchanged and already correct: permissions: id-token: write, npm publish --access public --provenance --tag <input> --ignore-scripts, registry-url, dispatch-only trigger, dry-run default.

package.json — already compliant, no change needed

Verified against @relayfile/core and @relaycron/sdk. Both use exactly publishConfig: {"access": "public"} (provenance comes from the CLI flag, not this field) plus a repository field, which provenance needs to link the source. This package already has both, plus license, files, and type. The references add repository.directory only because they are monorepo leaves; a single-package repo correctly omits it.

⚠️ Reference repos diverge on the npm pin — flagging rather than guessing

They agree on everything else, but not this:

Repo npm pin Node
relayfile npm@11 22
relaycron npm@latest 22.14.0
relayflows npm@latest

I matched relayfile's npm@11, deliberately. npm@latest will eventually resolve to npm 12, which requires Node ≥ 22.22.2 — so on a workflow pinned to Node 22.14.0, @latest is a latent break waiting for the npm 12 rollout. This exact trap is already documented in relayauth's publish workflow, which pins npm@11.18.0 and explains why. Pinning the 11 line keeps OIDC support while staying Node-22 compatible.

Worth a follow-up on relaycron/relayflows, which carry the same latent risk. Out of scope here.

Operator step required before a real publish

This workflow cannot publish until the repository owner registers a trusted publisher for @agent-relay/sandbox on npmjs.org — repo AgentWorkforce/sandbox, workflow .github/workflows/publish.yml. That registration is the OIDC equivalent of granting a token, and it is the owner's step, exactly as adding NPM_TOKEN would have been. Until then a non-dry-run publish fails at the registry.

I have not published and will not publish.


Summary by cubic

Switch the publish workflow to npm OIDC trusted publishing (tokenless) for safer, simpler releases. Removes token steps, pins npm to the 11 line for OIDC support, and updates docs; no runtime code changed.

  • Refactors

    • Removed NODE_AUTH_TOKEN and the NPM_TOKEN guard step in the workflow.
    • Added npm install -g npm@11 to ensure OIDC support while staying compatible with Node 22.
    • Aligned dry-run with real publish: --dry-run --access public --tag <input> --ignore-scripts.
    • Updated README to document trusted-publisher setup and provenance.
  • Migration

    • Repository owner must register this repo and workflow as a trusted publisher for @agent-relay/sandbox on npmjs.org; until then only dry-run will succeed.

Written for commit 4ab9210. Summary will update on new commits.

Review in cubic

Matches the shape used by relayfile, relaycron, and relayflows: tokenless
auth via `id-token: write`, with the registry exchanging a short-lived
GitHub OIDC token.

- Remove the `NODE_AUTH_TOKEN` env from the publish step
- Remove the "Require NPM_TOKEN" guard step
- Pin npm to the 11 line (OIDC trusted publishing needs >= 11.5.1)
- Align the dry-run invocation with the reference repos (--tag passed)
- README documents the trusted-publisher setup and provenance

package.json already matched the reference convention (repository set,
publishConfig.access public, license, files), so it needs no change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@khaliqgant khaliqgant added the no-agent-relay-review Exclude from agent-relay automated review label Jul 18, 2026
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@khaliqgant, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9f7610c8-8c48-47fc-8c7d-41d960d8101f

📥 Commits

Reviewing files that changed from the base of the PR and between 6c090d6 and 4ab9210.

📒 Files selected for processing (2)
  • .github/workflows/publish.yml
  • README.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/oidc-trusted-publishing

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the README.md documentation to reflect a transition from using manual NPM_TOKEN secrets to npm OIDC trusted publishing for package releases. There are no review comments, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@khaliqgant
khaliqgant marked this pull request as ready for review July 18, 2026 11:50
@khaliqgant
khaliqgant merged commit 6b94d51 into main Jul 18, 2026
2 checks passed
@cursor

cursor Bot commented Jul 18, 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.

@khaliqgant
khaliqgant deleted the chore/oidc-trusted-publishing branch July 18, 2026 11:50

@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: 4ab921047e

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


- name: Publish
if: ${{ github.event.inputs.dry_run != 'true' }}
run: npm publish --access public --provenance --tag ${{ github.event.inputs.tag }} --ignore-scripts

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 Preserve authentication for the initial package publish

For the first release of this new 0.0.0 package, this tokenless command cannot succeed: npm's trusted publishing documentation requires the package to already exist before a trusted publisher can be configured. Since the commit removes the only token-based path, the owner cannot perform the initial publish needed to create @agent-relay/sandbox; retain a one-time authenticated bootstrap path or document and implement a separate initial-publish procedure before switching entirely to OIDC.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-agent-relay-review Exclude from agent-relay automated review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant