-
Notifications
You must be signed in to change notification settings - Fork 14
Add permission to generate OIDC tokens for npm-publishing workflow #616
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
|
55d9ccf to
e646c68
Compare
| environment: publish-npm | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/setup-node@v4 |
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.
This step is added so we get a new enough node version. When I tested on my own repo, the default was using node 20, and thus too low a npm version (10.x.y)
See this run for what we get when adding this "uses"-step
https://github.com/anderson4j/clonedLangSupp/actions/runs/19966528562/job/57259666256
As you can see, the npm version becomes 11.6.2 > 11.5.1, which is what we need according to the npm page for trusted publishing
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.
I replaced this with the more correct approach of changing the setup-and-build action
… in publish-npm-packages Also updates package to use node 24 just like CI will
| "devDependencies": { | ||
| "@changesets/cli": "^2.28.1", | ||
| "@types/node": "^22.15.0", | ||
| "@types/node": "^24.10.1", |
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.
This was highest release on npm. I would've thought this version was 1-1 with node version based on the old version, but I suppose not. Using this works though
3457287 to
1285016
Compare
Following this tutorial: https://docs.npmjs.com/trusted-publishers
I've set up trusted publishing for the npm packages on npmjs - could be worth logging into our account and checking that this looks correct. The final part needed is this small permission change on the workflow, as well as making sure we run npm cli >= 11.5.1
Closes LS-49