Skip to content

debug(ci): show .npmrc + verbose npm publish - #11

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

debug(ci): show .npmrc + verbose npm publish#11
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

JS-DevTools/npm-publish@v3 requires a token (verified by failure: 'Input required and not supplied: token'), so it can't do OIDC. Reverting to vanilla npm publish but adding verbose logging + .npmrc inspection to see why OIDC isn't auto-engaging despite all env vars being correct (OIDC claims confirmed correct in previous run).

Summary by CodeRabbit

  • Chores
    • Updated release automation to publish packages with enhanced verification.

Review Change Stack

@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 now publishes packages directly via npm publish with provenance support instead of delegating to a third-party action. A new debugging step inspects npm authentication configuration to ensure OIDC trusted publishing is enabled, masking sensitive tokens while displaying auth-related config entries.

Changes

npm publish workflow update

Layer / File(s) Summary
Replace npm publish mechanism and add auth debugging
.github/workflows/release.yml
Version check remains unchanged. Publishing now runs npm publish --provenance --access public --loglevel=verbose instead of the JS-DevTools/npm-publish@v3 action, under the same version-change condition. A new conditional step displays .npmrc state and filtered npm auth/provenance config (with _authToken masked) to confirm OIDC trusted publishing will be used.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • charfeng1/opencode-ralph-loop#10: Both PRs modify the publish job in .github/workflows/release.yml to adjust npm publishing with OIDC trusted publishing support.
  • charfeng1/opencode-ralph-loop#9: Both PRs modify the same release workflow to configure npm publish with --provenance and related OIDC behavior.
  • charfeng1/opencode-ralph-loop#8: Both PRs adjust .github/workflows/release.yml publishing steps to enable npm OIDC trusted publishing instead of token-based auth.

Poem

🐰 The publish action fades away,
Direct npm claims the day,
With provenance bright and auth on display—
OIDC trusted, hip hip hooray!
No tokens hiding in the shade,
This workflow's now OIDC-made! 📦✨

🚥 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 describes the main changes: adding debug output for .npmrc configuration and using verbose npm publish instead of the JS-DevTools action.
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 117-123: The log redaction is too narrow: the cat ... | sed
's/_authToken=.*/_authToken=<MASKED>/' and the npm config list ... | grep ...
command can still emit other credential forms; update the run block so the cat
of ~/.npmrc and ./.npmrc and the output of npm config list are piped through a
stronger redaction step that uses a single sed -E (or perl) regex to redact keys
like _authToken, _auth, _password, authToken (quoted or spaced assignments),
base64 auth values and any credential-looking values (e.g. /:_auth
*=.*|_password *=.*|_authToken *=.*|auth
*=.*|\"authToken\":\s*\"[^\"]+\"|\"_password\":\s*\"[^\"]+\"), and/or obtain npm
config as JSON (npm config list --json) and programmatically replace sensitive
values before printing; replace the existing sed invocation on the cat lines and
the npm config list pipeline with this stronger redaction step so all credential
forms are masked before logging.
🪄 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: 055b836a-8b37-4afa-ae7f-5410a9719fa8

📥 Commits

Reviewing files that changed from the base of the PR and between 42262ce and e60b975.

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

Comment on lines +117 to +123
run: |
echo "--- ~/.npmrc ---"
cat ~/.npmrc 2>/dev/null | sed 's/_authToken=.*/_authToken=<MASKED>/' || echo "(no ~/.npmrc)"
echo "--- ./.npmrc ---"
cat ./.npmrc 2>/dev/null | sed 's/_authToken=.*/_authToken=<MASKED>/' || echo "(no ./.npmrc)"
echo "--- npm config (auth) ---"
npm config list 2>&1 | grep -iE "registry|auth|provenance" || true

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 | 🔴 Critical | ⚡ Quick win

Harden masking before printing npm config to logs.

Line 119 and Line 121 only mask _authToken=..., but other credential forms can still be emitted (_auth, _password, quoted/spaced token assignments). This can leak secrets in CI logs.

Suggested safe redaction patch
       - name: Show .npmrc state
         if: steps.check.outputs.changed == 'true'
         run: |
+          redact_npmrc() {
+            sed -E \
+              -e 's#(_authToken\s*=\s*).*#\1<MASKED>`#I`' \
+              -e 's#(_auth\s*=\s*).*#\1<MASKED>`#I`' \
+              -e 's#(_password\s*=\s*).*#\1<MASKED>`#I`' \
+              -e 's#(\/\/[^:]+:[^=]*_authToken\s*=\s*).*#\1<MASKED>`#I`'
+          }
           echo "--- ~/.npmrc ---"
-          cat ~/.npmrc 2>/dev/null | sed 's/_authToken=.*/_authToken=<MASKED>/' || echo "(no ~/.npmrc)"
+          cat ~/.npmrc 2>/dev/null | redact_npmrc || echo "(no ~/.npmrc)"
           echo "--- ./.npmrc ---"
-          cat ./.npmrc 2>/dev/null | sed 's/_authToken=.*/_authToken=<MASKED>/' || echo "(no ./.npmrc)"
+          cat ./.npmrc 2>/dev/null | redact_npmrc || echo "(no ./.npmrc)"
           echo "--- npm config (auth) ---"
-          npm config list 2>&1 | grep -iE "registry|auth|provenance" || true
+          npm config list 2>&1 | grep -iE "registry|auth|provenance|password|token" | redact_npmrc || true
🤖 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 117 - 123, The log redaction is
too narrow: the cat ... | sed 's/_authToken=.*/_authToken=<MASKED>/' and the npm
config list ... | grep ... command can still emit other credential forms; update
the run block so the cat of ~/.npmrc and ./.npmrc and the output of npm config
list are piped through a stronger redaction step that uses a single sed -E (or
perl) regex to redact keys like _authToken, _auth, _password, authToken (quoted
or spaced assignments), base64 auth values and any credential-looking values
(e.g. /:_auth *=.*|_password *=.*|_authToken *=.*|auth
*=.*|\"authToken\":\s*\"[^\"]+\"|\"_password\":\s*\"[^\"]+\"), and/or obtain npm
config as JSON (npm config list --json) and programmatically replace sensitive
values before printing; replace the existing sed invocation on the cat lines and
the npm config list pipeline with this stronger redaction step so all credential
forms are masked before logging.

@charfeng1
charfeng1 merged commit 2ab78af 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