File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 publish_template :
2222 runs-on : ubuntu-latest
2323 environment : npm-publish
24+ permissions :
25+ # Required for npm trusted publishing (OIDC token exchange with the registry)
26+ id-token : write
27+ # Required so the bump commit & tag can be pushed back to the branch
28+ contents : write
2429 steps :
2530 - name : Safeguard against branch name
2631 run : |
@@ -31,10 +36,18 @@ jobs:
3136 - name : Checkout
3237 uses : actions/checkout@v4.1.1
3338 - name : Setup node.js
34- uses : actions/setup-node@v4.0.0
39+ # setup-node@v6 supports npm trusted publishing (OIDC): with `registry-url`
40+ # set and no token provided, it configures the registry without writing a
41+ # bogus NODE_AUTH_TOKEN placeholder, so `npm publish` performs the OIDC
42+ # token exchange. Older versions (e.g. v4) wrote a placeholder token that
43+ # made npm attempt token auth instead, failing with E404/ENEEDAUTH.
44+ uses : actions/setup-node@v6
3545 with :
3646 node-version : ' lts/*'
3747 registry-url : ' https://registry.npmjs.org'
48+ # Never cache dependencies in a publishing workflow: a poisoned cache
49+ # could expose the short-lived OIDC token.
50+ package-manager-cache : false
3851 - name : Determine new template version
3952 run : echo "VERSION=$(./scripts/bumpedTemplateVersion.sh ${{ inputs.version }})" >> $GITHUB_ENV
4053 - name : Update versions to input one
You can’t perform that action at this time.
0 commit comments