Skip to content

(ci)Update npm-publish workflow for npmjs.org OIDC/Trusted publishing#1654

Open
turbobobbytraykov wants to merge 1 commit intomasterfrom
btraykov/update-npm-for-npmjs-oidc
Open

(ci)Update npm-publish workflow for npmjs.org OIDC/Trusted publishing#1654
turbobobbytraykov wants to merge 1 commit intomasterfrom
btraykov/update-npm-for-npmjs-oidc

Conversation

@turbobobbytraykov
Copy link
Copy Markdown

@turbobobbytraykov turbobobbytraykov commented Apr 22, 2026

Description

This is one of the few remaining repos where we don't have Trusted Publishing to npmjs.org.
I have enabled Trusted Publishing for each package being published from this repo - I believe that publishing a new rc #4 is the best way to try this out.

Related Issue

Closes #

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring / code cleanup
  • Build / CI configuration change

Affected Packages

  • igniteui-cli (packages/cli)
  • @igniteui/cli-core (packages/core)
  • @igniteui/angular-templates (packages/igx-templates)
  • @igniteui/angular-schematics (packages/ng-schematics)
  • @igniteui/mcp-server (packages/igniteui-mcp)

Checklist

  • I have tested my changes locally (npm run test)
  • I have built the project successfully (npm run build)
  • I have run the linter (npm run lint)
  • I have added/updated tests as needed
  • My changes do not introduce new warnings or errors

Additional Context

@turbobobbytraykov
Copy link
Copy Markdown
Author

@damyanpetev , according to the initial official docs for Trusted Publishing:
https://docs.npmjs.com/trusted-publishers
image
My concern is that we are currently using node 20 - for this version npm can be updated to v 11.12.1 , so at least npm is OK and I hope that that's sufficient.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 use npmjs.org Trusted Publishing (OIDC) instead of an NPM_TOKEN, aligning this repo with the newer publishing model for the listed packages.

Changes:

  • Grants id-token: write so the workflow can request an OIDC token for npm Trusted Publishing.
  • Updates npm in the runner prior to publishing.
  • Removes NODE_AUTH_TOKEN injection (token-based auth) from the publish step.

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

Comment on lines 6 to 8
permissions:
id-token: write
contents: read
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

Consider scoping id-token: write to the specific job (or even the publishing step via job-level permissions) instead of workflow-wide permissions. This keeps least-privilege if additional jobs are added later.

Copilot uses AI. Check for mistakes.
registry-url: "https://registry.npmjs.org"

- name: 'Update NPM' # needed for npmjs.org Trusted Publishing
run: npm install -g npm@latest
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

Using npm@latest makes the publish workflow non-reproducible and can break future releases unexpectedly when npm publishes a new major. Prefer pinning to a known-good npm major/minor that supports npmjs Trusted Publishing (and update intentionally when needed), or document the minimum required npm version.

Suggested change
run: npm install -g npm@latest
run: npm install -g npm@11.5.1

Copilot uses AI. Check for mistakes.
@@ -37,5 +41,3 @@ jobs:
# use npm run as yarn run changes the registry and publishes to https://registry.yarnpkg.com
run: npm run deploy ${NPM_TAG}
# define env variable for the specific run
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

The comment about defining an env variable is now stale since the env: block with NODE_AUTH_TOKEN was removed. Please update or remove this comment to avoid confusion about how authentication works with Trusted Publishing.

Suggested change
# define env variable for the specific run

Copilot uses AI. Check for mistakes.
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 86.296%. remained the same — btraykov/update-npm-for-npmjs-oidc into master

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants