Skip to content

fix(ci): JS-DevTools/npm-publish + OIDC claims debug - #10

Merged
charfeng1 merged 1 commit into
masterfrom
fix/ci-use-js-devtools-publish
May 16, 2026
Merged

fix(ci): JS-DevTools/npm-publish + OIDC claims debug#10
charfeng1 merged 1 commit into
masterfrom
fix/ci-use-js-devtools-publish

Conversation

@charfeng1

@charfeng1 charfeng1 commented May 16, 2026

Copy link
Copy Markdown
Owner

Vanilla npm publish on npm 11.14.1 returns ENEEDAUTH even with OIDC env vars + --provenance flag. Switch to JS-DevTools/npm-publish@v3 (zod / vite / etc use this for OIDC trust publishing). Adds one-time debug step that decodes the OIDC JWT to show claims being sent — if trust config on npm doesn't match, this will surface the mismatch.

Summary by CodeRabbit

  • Chores
    • Enhanced package publishing process with improved security validation and provenance capabilities.

Review Change Stack

After confirmed-failing attempts with vanilla 'npm publish --provenance' on
npm 11.14.1 (ENEEDAUTH despite OIDC env vars), switch to JS-DevTools/npm-publish@v3
which is the action used by zod / vite / other major OSS for OIDC trusted
publishing. Battle-tested for this exact flow.

Also adds a one-time debug step that decodes the GitHub OIDC token to print
the claims (repository, workflow, ref, sub) — if trusted publisher config
on npm doesn't exactly match these, that's our smoking gun.
@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The release workflow is updated to support npm trusted publishing. A new step decodes the GitHub Actions OIDC token and logs JWT claims for validation. The publish invocation switches from an inline npm command to the JS-DevTools/npm-publish@v3 action with provenance enabled.

Changes

npm Trusted Publishing Setup

Layer / File(s) Summary
OIDC token validation and logging
.github/workflows/release.yml
New shell step fetches and decodes the OIDC ID token JWT payload, logging the claims (repository, workflow, ref, environment, sub, aud) that npm uses to validate trusted publishers.
Publish step with provenance
.github/workflows/release.yml
Publish invocation transitions from inline npm publish --provenance --access public to JS-DevTools/npm-publish@v3 action with provenance and access: public inputs enabled.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • charfeng1/opencode-ralph-loop#8: Both PRs modify the same npm-publish workflow in .github/workflows/release.yml to support npm OIDC trusted publishing by changing how token and JWT claims are handled.
  • charfeng1/opencode-ralph-loop#7: Both PRs modify .github/workflows/release.yml's publish job—this one switches to the JS-DevTools/npm-publish@v3 trusted-provenance flow while the other adjusts the Node/npm version for trusted publishing compatibility.
  • charfeng1/opencode-ralph-loop#9: Both PRs modify .github/workflows/release.yml npm publish setup to add and ensure npm provenance and OIDC-related trusted publishing validation.

Poem

🐰 A token arrives, decoded with care,
JWT claims floating through GitHub's air,
JS-DevTools steps in, provenance in hand,
npm trusts the workflow across the land! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: switching to JS-DevTools/npm-publish action and adding OIDC JWT claims debugging for npm trusted publishing validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ci-use-js-devtools-publish

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

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release.yml:
- Around line 115-118: Replace the mutable tag reference to the third-party
action used in the workflow (the uses entry "JS-DevTools/npm-publish@v3") with a
full commit SHA to pin the action; update the uses value to
"JS-DevTools/npm-publish@<full-commit-sha>" (obtain the SHA from the action
repo), commit that change, and consider adding a note to track updates via
Dependabot or similar so future upgrades are managed safely.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e2920132-9ef7-4ca1-9a71-5fae9b76ce52

📥 Commits

Reviewing files that changed from the base of the PR and between 0140c36 and 377465a.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

Comment on lines +115 to +118
uses: JS-DevTools/npm-publish@v3
with:
provenance: true
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/release.yml | sed -n '100,130p'

Repository: charfeng1/opencode-ralph-loop

Length of output: 1659


🏁 Script executed:

cat -n .github/workflows/release.yml | sed -n '1,150p'

Repository: charfeng1/opencode-ralph-loop

Length of output: 6172


🌐 Web query:

GitHub actions security hardening pin action full commit SHA third-party

💡 Result:

Pinning GitHub Actions to a full-length commit SHA is a critical security best practice for supply chain hardening [1][2][3]. Because version tags (e.g., @v4) and branch references (e.g., @main) are mutable, they can be updated or force-pushed by an action maintainer—or a malicious actor who compromises the maintainer's account—to point to different, potentially malicious code at any time [4][5][6]. Why Pinning to a Full Commit SHA is Necessary: - Immutability: A full-length (40-character) commit SHA uniquely identifies a specific state of a repository [5][7]. Once pinned, the code executed by your workflow cannot be altered, ensuring consistency and reproducibility [7][6]. - Mitigation of Supply Chain Attacks: If an action's repository is compromised, pinning prevents your workflows from automatically pulling in injected malicious code [7][2]. An attacker would need to generate a SHA-1 collision to replace the pinned code, which is computationally infeasible [5][2]. - Organizational Policy: GitHub allows administrators to enforce full commit SHA pinning at the organization or repository level [1][2]. When enabled, workflows referencing actions by mutable tags will fail, forcing compliance across the dependency tree [1]. Best Practices for Implementation: - Use Full SHAs: Always use the full 40-character SHA, not a shortened version [5]. - Verify Sources: Ensure the SHA originates from the official action repository, not a fork [5][2]. - Maintainability: To manage updates, use automated dependency management tools like Dependabot or Renovate [1][5][6]. You can include the version tag as a comment in your workflow file to make it easier to track which version the SHA corresponds to (e.g., uses: actions/checkout@a12b34... # v4.1.1) [8][5][6]. - Audit Dependencies: Pinning is one layer of defense; you should also audit the source code of third-party actions and limit their use to trusted publishers [2][3][9]. Note: While pinning is essential, it should be part of a broader security strategy that includes limiting token permissions, using OIDC for secrets, and auditing workflow configurations [10][3][11].

Citations:


Pin this third-party action to a full commit SHA.

The JS-DevTools/npm-publish@v3 action is currently referenced by a mutable version tag. GitHub's security guidance recommends pinning third-party actions to full-length commit SHAs for supply chain hardening, especially in jobs with elevated permissions like this one (which has contents: write and id-token: write). Version tags can be force-pushed or compromised; only full commit SHAs are immutable and cannot be altered retroactively. Consider using a tool like Dependabot to manage updates.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yml around lines 115 - 118, Replace the mutable
tag reference to the third-party action used in the workflow (the uses entry
"JS-DevTools/npm-publish@v3") with a full commit SHA to pin the action; update
the uses value to "JS-DevTools/npm-publish@<full-commit-sha>" (obtain the SHA
from the action repo), commit that change, and consider adding a note to track
updates via Dependabot or similar so future upgrades are managed safely.

@charfeng1
charfeng1 merged commit 42262ce into master May 16, 2026
4 checks passed
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