Skip to content

Update publish#50

Merged
esezen merged 1 commit into
mainfrom
nocdx-update-publish-workflow
May 27, 2026
Merged

Update publish#50
esezen merged 1 commit into
mainfrom
nocdx-update-publish-workflow

Conversation

@esezen
Copy link
Copy Markdown
Contributor

@esezen esezen commented May 27, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 27, 2026 15:36
@esezen esezen requested a review from a team as a code owner May 27, 2026 15:36
Copy link
Copy Markdown
Contributor

@Mudaafi Mudaafi left a comment

Choose a reason for hiding this comment

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

lgtm

@esezen esezen merged commit 045d54c into main May 27, 2026
9 of 10 checks passed
@esezen esezen deleted the nocdx-update-publish-workflow branch May 27, 2026 15:37
Copy link
Copy Markdown

@constructor-claude-bedrock constructor-claude-bedrock Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This PR migrates NPM publishing from token-based authentication (NPM_TOKEN secret) to OIDC-based Trusted Publishing, which is a good security improvement. The approach is mostly correct but has a few issues to address before merging.

Inline comments: 3 discussions added

Overall Assessment: ⚠️ Needs Work

- name: Install npm 11
run: npm install -g npm@11

- name: Debug node and npm versions
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Important Issue: This is a debug step that should not be committed to a production workflow. Remove it before merging. Version information is already surfaced implicitly by the runner logs and does not warrant a dedicated step in a persistent workflow.

token: ${{ secrets.NPM_TOKEN }}

- name: Install npm 11
run: npm install -g npm@11
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Important Issue: Pinning to a floating major version (npm@11) makes the workflow non-deterministic — patch/minor releases within npm v11 may introduce unexpected behaviour over time. Pin to a specific version (e.g. npm@11.4.1) to guarantee reproducible builds. Additionally, installing npm globally as a workflow step adds latency and a potential point of failure; consider whether the npm version bundled with Node 22.18.x is insufficient before adding this step.

version: ${{ inputs.version }}

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Critical Issue: When publishing to npm via OIDC (Trusted Publishers), actions/setup-node must be configured with registry-url: https://registry.npmjs.org/ so that the action writes the correct .npmrc configuration and sets NODE_AUTH_TOKEN from the OIDC token exchange. Without registry-url, the generated .npmrc is absent and npm publish will either fail to authenticate or silently skip provenance attestation. Add:

- uses: actions/setup-node@v4
  with:
    node-version: 22.18.x
    registry-url: https://registry.npmjs.org/

See: https://docs.npmjs.com/generating-provenance-statements#publishing-provenance-in-a-cicd-workflow

@esezen esezen review requested due to automatic review settings May 27, 2026 16:10
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.

2 participants