-
Notifications
You must be signed in to change notification settings - Fork 819
chore(npm): Update release npm action to stop using tokens #6443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modernizes the GitHub Actions workflows for Stencil's release pipelines by updating action versions and simplifying NPM authentication configuration.
- Updates
actions/checkoutfrom v4.1.7 to v5.0.0 andactions/setup-nodefrom an implicit usage to explicit v6.0.0 across all release workflows - Replaces manual
.npmrctoken configuration withactions/setup-noderegistry configuration - Adds emoji prefixes to workflow step names for improved visual scanning
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
.github/workflows/release-production.yml |
Updates action versions, replaces manual NPM token setup with actions/setup-node configuration, and adds step to ensure latest npm version |
.github/workflows/release-nightly.yml |
Updates action versions, adds emoji step names, and modifies token parameter name from token to github-token |
.github/workflows/release-dev.yml |
Updates action versions, adds emoji step names, and modifies token parameter name from token to github-token |
.github/workflows/actions/publish-npm/action.yml |
Removes manual .npmrc configuration, adds actions/setup-node with registry configuration, adds new inputs for node-version and registry-url, and removes token input |
Comments suppressed due to low confidence (1)
.github/workflows/release-production.yml:71
- The
npm run release.cicommand likely performs publishing operations that require NPM authentication. Since the manual.npmrcconfiguration was removed, you need to addenv: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}to this step to ensure proper authentication when the publish scripts run.
- name: 📦 Run Publish Scripts
# pass the generated version number instead of the input, since we've already incremented it in the prerelease
# step
run: npm run release.ci -- --tag ${{ inputs.tag }}
shell: bash
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
.github/workflows/release-production.yml:71
- The
npm run release.cicommand likely performsnpm publish, but noNODE_AUTH_TOKENenvironment variable is set on this step. After configuringactions/setup-nodewithregistry-urlat line 58, you need to provide authentication. Addenv: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}to this step, or ensure the entire job has access to this environment variable if using token-based authentication. Alternatively, if relying on OIDC with provenance (given theid-token: writepermission), verify that therelease.ciscript properly supports this authentication method.
- name: 📦 Run Publish Scripts
# pass the generated version number instead of the input, since we've already incremented it in the prerelease
# step
run: npm run release.ci -- --tag ${{ inputs.tag }}
shell: bash
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
.github/workflows/release-production.yml:71
- The
npm run release.cicommand likely performs npm publish operations but is missing theNODE_AUTH_TOKENenvironment variable. When usingactions/setup-nodewithregistry-url, authentication requires settingNODE_AUTH_TOKENin the environment.
Add an env section to this step:
- name: 📦 Run Publish Scripts
run: npm run release.ci -- --tag ${{ inputs.tag }}
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: 📦 Run Publish Scripts
# pass the generated version number instead of the input, since we've already incremented it in the prerelease
# step
run: npm run release.ci -- --tag ${{ inputs.tag }}
shell: bash
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
.github/workflows/release-production.yml:71
- The
npm run release.cicommand likely performs npm publish operations but is missing the requiredNODE_AUTH_TOKENenvironment variable. Add anenvsection withNODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}to enable authentication with the npm registry.
- name: 📦 Run Publish Scripts
# pass the generated version number instead of the input, since we've already incremented it in the prerelease
# step
run: npm run release.ci -- --tag ${{ inputs.tag }}
shell: bash
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What is the current behavior?
release-dev,release-nightly,release-production) and the reusable publish-npm action still inject a long-livedNPM_TOKEN, so they do not use npm’s trusted-publisher/OIDC flow.GitHub Issue Number: N/A
What is the new behavior?
publish-npmaction to set up Node with the npm registry, upgrade npm, and publish with provenance using the OIDC credential..npmrctoken writes from the dev and nightly workflows; they now rely solely on the reusable action.npm run release.ci.Documentation
Does this introduce a breaking change?
Testing
Other information