@@ -78,11 +78,21 @@ jobs:
7878 with :
7979 node-version : 20
8080 registry-url : ' https://registry.npmjs.org'
81+ - name : Update npm to latest (required for OIDC)
82+ run : npm install -g npm@latest
8183 - uses : rlespinasse/github-slug-action@v4.x
8284 - name : Append commit hash to package version
8385 run : ' sed -i -E "s/(\"version\": *\"[^\"]+)/\1-${GITHUB_SHA_SHORT}/" package.json'
8486 - name : Disable pre- and post-publish actions
8587 run : ' sed -i -E "s/\"((pre|post)publish)/\"ignore:\1/" package.json'
88+ - name : Clear npm authentication cache
89+ run : |
90+ rm -rf ~/.npm/_cacache || true
91+ rm -f ~/.npmrc || true
92+ - name : Verify npm version
93+ run : npm --version
94+ - name : Check npm configuration
95+ run : npm config list
8696 - name : Publish to npm
8797 if : github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
8898 run : npm publish --tag ${{ env.GITHUB_REF_SLUG }}
@@ -102,8 +112,18 @@ jobs:
102112 with :
103113 node-version : 20
104114 registry-url : ' https://registry.npmjs.org'
115+ - name : Update npm to latest (required for OIDC)
116+ run : npm install -g npm@latest
105117 - name : Disable pre- and post-publish actions
106118 run : ' sed -i -E "s/\"((pre|post)publish)/\"ignore:\1/" package.json'
119+ - name : Clear npm authentication cache
120+ run : |
121+ rm -rf ~/.npm/_cacache || true
122+ rm -f ~/.npmrc || true
123+ - name : Verify npm version
124+ run : npm --version
125+ - name : Check npm configuration
126+ run : npm config list
107127 - name : Publish to npm
108128 if : github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
109129 run : npm publish --tag latest
0 commit comments