3535 - name : Update npm to latest
3636 run : npm install -g npm@latest
3737
38- - name : Configure NPM for OIDC (run steps below)
39- run : |
40- echo "//registry.npmjs.org/:_authToken=" > "$HOME/.npmrc"
41- echo "@shopify:registry=https://registry.npmjs.org/" >> "$HOME/.npmrc"
42-
4338 - id : changesets
4439 name : Create release Pull Request or publish to NPM
4540 uses : changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba # v1.5.3
@@ -53,12 +48,18 @@ jobs:
5348
5449 - name : Temporary manual sync 'latest' tag # will be removed after sync
5550 if : github.event_name == 'workflow_dispatch' && github.ref_name == vars.LATEST_STABLE_VERSION
51+ env :
52+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
5653 run : |
57- # Debug info (contents from above)
58- echo "--- Contents of $HOME/.npmrc ---"
59- cat "$HOME/.npmrc"
54+ # dist-tag does not support OIDC yet, so fallback to classic token
55+ # overwrite the .npmrc to ensure no OIDC session conflicts
56+ echo "---Overwriting $NPM_CONFIG_USERCONFIG ---"
57+ echo "@shopify:registry=https://registry.npmjs.org/" > "$NPM_CONFIG_USERCONFIG"
58+ echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> "$NPM_CONFIG_USERCONFIG"
59+
60+ # Debug info
6061 echo "--- npm identity check ---"
61- npm whoami --registry=https://registry.npmjs.org/ || echo "whoami failed (expected if OIDC not yet triggered)"
62+ npm whoami --registry=https://registry.npmjs.org/
6263
6364 # Run with info logging
6465 npm dist-tag add @shopify/[email protected] latest --loglevel=info 6768 if : steps.changesets.outputs.published == 'true' && github.ref_name == vars.LATEST_STABLE_VERSION
6869 env :
6970 PUBLISHED_PACKAGES : ${{ steps.changesets.outputs.publishedPackages }}
71+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
7072 run : |
73+ # dist-tag does not support OIDC yet, so fallback to classic token
74+ # overwrite the .npmrc to ensure no OIDC session conflicts
75+ echo "@shopify:registry=https://registry.npmjs.org/" > "$NPM_CONFIG_USERCONFIG"
76+ echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> "$NPM_CONFIG_USERCONFIG"
77+
7178 for pkg in $(echo "$PUBLISHED_PACKAGES" | jq -r '.[] | @base64'); do
7279 _jq() {
7380 echo ${pkg} | base64 --decode | jq -r ${1}
0 commit comments