ci: authenticate publish workflows to Cloudsmith via OIDC#2405
Draft
jmeredithg wants to merge 5 commits into
Draft
ci: authenticate publish workflows to Cloudsmith via OIDC#2405jmeredithg wants to merge 5 commits into
jmeredithg wants to merge 5 commits into
Conversation
Member
|
@cursoragent could you clean up the PR title here as well as any prettier issues preventing this from passing CI |
|
I've fixed both issues: Prettier formatting - Fixed formatting in all 4 workflow files and committed the changes:
PR title - Updated from "Authenticate publish workflow(s) to Cloudsmith via OIDC" to "ci: authenticate publish workflows to Cloudsmith via OIDC" to follow the conventional commit format. Both CI checks should now pass on the next run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What
Migrates all four npm publish/unpublish workflows off
registry.npmjs.organd onto our internal Cloudsmith instance (https://cloudsmith.io/gusto/gusto), authenticating via GitHub OIDC instead of a staticNPM_TOKENsecret.Each workflow now:
cloudsmith-io/cloudsmith-cli-action@v2step (oidc-auth-only: "true") beforeactions/setup-node, which exchanges the job's GitHub OIDC token for a Cloudsmith token and exports it asCLOUDSMITH_API_KEYin the job env.actions/setup-node'sregistry-urlathttps://cloudsmith.io/gusto/gusto.NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}forNODE_AUTH_TOKEN: ${{ env.CLOUDSMITH_API_KEY }}on the publish/unpublish step.id-token: writeto the job'spermissionsblock (all four jobs already had apermissionsblock with other entries, which are left untouched).Files touched
.github/workflows/publish.yaml.github/workflows/publish-rc.yaml.github/workflows/unpublish.yaml.github/workflows/unpublish-rc.yamlPrecedent
This is the same OIDC auth pattern already merged/open for RubyGems in Gusto/virtuous-pdf#452 and Gusto/fixture_kit#70, adapted here for npm (registry-url +
NODE_AUTH_TOKENinstead of a gem credentials file).Status / caveats
Draft PR. The Cloudsmith npm endpoint format (
https://cloudsmith.io/gusto/gusto) has only been confirmed for RubyGems repos so far — it has not been runtime-verified against npm publish/unpublish yet. Holding as draft until a real publish/unpublish run against this workflow confirms the registry URL and auth handshake work for the npm package type.secrets.NPM_TOKENreferences have been fully removed from all four files since nothing else in this repo depends on them.