Skip to content

Update workflow#298

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

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

Conversation

@esezen

@esezen esezen commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings June 1, 2026 19:19
@esezen esezen requested a review from a team as a code owner June 1, 2026 19:19

@constructor-claude-bedrock constructor-claude-bedrock 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 PR migrates NPM publishing from token-based authentication (NPM_TOKEN) to OIDC-based Trusted Publishers, which is a security improvement. The implementation is mostly correct, but there are a few issues worth addressing 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 debug step should be removed before merging. Leaving debug steps in production CI workflows adds noise to every future run and may expose version information unnecessarily. If version visibility is needed for troubleshooting, it can be obtained from the runner logs of the setup-node and Install npm 11 steps.

token: ${{ secrets.NPM_TOKEN }}
node-version: 22.18.x

- name: Install 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: The npm version is pinned loosely as npm@11, which will silently install whatever the latest npm 11.x.x is at run time. This can introduce unexpected behavior from minor or patch version changes between runs. Pin to a specific version (e.g., npm@11.4.1) to ensure reproducible builds, consistent with how node-version is now pinned to 22.18.x.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the npm publish GitHub Actions workflow to support npm “trusted publishers” (OIDC-based auth) instead of using an NPM_TOKEN.

Changes:

  • Adds permissions: id-token: write / contents: read to enable OIDC authentication with npm.
  • Pins Node to a specific 22.18 minor line and adds a step to install npm v11 (plus a debug version print).
  • Removes NODE_AUTH_TOKEN usage during npm publish, relying on OIDC instead.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 64 to 68
run: |
# updates the package.json version field
jq --arg new_version "${{ steps.version.outputs.without_prefix }}" '.version = $new_version' package.json > tmp.json && mv tmp.json package.json

echo "new-version=$new_version" >> $GITHUB_OUTPUT
Comment on lines 45 to +46
with:
node-version: 22.x
registry-url: https://registry.npmjs.org/
scope: '@constructorio'
token: ${{ secrets.NPM_TOKEN }}
node-version: 22.18.x

@Mudaafi Mudaafi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

trusted publishers is pretty cool

@esezen esezen merged commit 99648fa into main Jun 1, 2026
12 of 13 checks passed
@esezen esezen deleted the nocdx-update-publish-workflow branch June 1, 2026 19:25
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.

3 participants