Migrate to OIDC Trusted Publishing#36
Conversation
|
Also, this is a tiny point, but I suggest placing the "update version" commit before the "remove npm-token input" commit, since that order is technically safe, but if we were to run CI on each commit in the current order, there would be errors due to invalid inputs! |
|
@tanjeemh Great PR description. Can you please include hyperlinks to where we conducted our testing? Workflow run logs will only be accessible for 90 days, so consider screenshotting those if necessary, but we will still be able to see the pass/fail outcome of a workflow run. Also suggest linking to the successfully-created beta tag and pre-release on npmjs.com as evidence of a successful run |
The reason we are using the "ci" prefix for the commit message is because We do not want to actually trigger a new release here, take a look at DX-2123 for more details. Now that `npm-token` is no longer a required secret, we can check the release logs and see that OIDC Trusted Publishing is being used. The change to the `npm-token` requirement was made in the pinned SHA version 3.1.0 of semantic-release-action/typescript. Ticket: DX-2243
|
🎉 This PR is included in version 2.1.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
Darn, it still created a release. I'll unpublish it since it is immaterial. |
What problem are we solving?
With OIDC Trusted Publishing, GHA authenticates directly with npm using short-lived identity tokens instead.
Why solve it this way?
This PR migrates our semantic-release workflow to use OIDC Trusted Publishing for npm releases. Previously, our release pipeline required an
npm-tokensecret to authenticate with npm during publishing. This approach has since been discouraged by npm themselves.Fixes:
npm-tokenas a required secret, allowing us to remove that input so GHA knows to publish via OIDC Trusted Publishing.id-token: writepermissions to the workflow to allow for GHA to request an OIDC token at runtime.semantic-release-action/typescript/release.yml@v3.1.0Testing:
From our test/check logs, we can confirm that OIDC is being used instead of an npm token to establish a connection to npm.
As confirmation of a successful release, see the beta pre-release tag that was created in the repo and in npmjs: https://www.npmjs.com/package/@bitgo-forks/io-ts/v/2.1.5-beta.1

https://github.com/BitGo/io-ts/actions/runs/19077165991
*Note: this PR should not trigger a new official release to
@bitgo-forks/io-ts*