fix: isolate npm publish from injected auth config (#1886)
This commit is contained in:
parent
1ed5c9d94b
commit
7bc2b5e0e0
|
|
@ -51,7 +51,21 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: "npm"
|
cache: "npm"
|
||||||
registry-url: "https://registry.npmjs.org"
|
|
||||||
|
- name: Debug npm auth config surface
|
||||||
|
run: |
|
||||||
|
USERCONFIG=$(npm config get userconfig)
|
||||||
|
echo "npm userconfig: $USERCONFIG"
|
||||||
|
if [ -f "$USERCONFIG" ]; then
|
||||||
|
if rg -n "_authToken|always-auth|registry.npmjs.org" "$USERCONFIG" >/dev/null 2>&1; then
|
||||||
|
echo "npm userconfig contains registry auth-related entries"
|
||||||
|
rg -n "_authToken|always-auth|registry.npmjs.org" "$USERCONFIG" | sed -E 's/(_authToken=).*/\1***MASKED***/'
|
||||||
|
else
|
||||||
|
echo "npm userconfig has no registry auth-related entries"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "npm userconfig file not found"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Debug trusted publishing identity
|
- name: Debug trusted publishing identity
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -161,12 +175,14 @@ jobs:
|
||||||
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.channel == 'next')
|
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.channel == 'next')
|
||||||
run: npm publish --tag next --provenance
|
run: npm publish --tag next --provenance
|
||||||
env:
|
env:
|
||||||
|
NPM_CONFIG_USERCONFIG: /dev/null
|
||||||
NODE_AUTH_TOKEN: ""
|
NODE_AUTH_TOKEN: ""
|
||||||
|
|
||||||
- name: Publish stable release to npm
|
- name: Publish stable release to npm
|
||||||
if: github.event_name == 'workflow_dispatch' && inputs.channel == 'latest'
|
if: github.event_name == 'workflow_dispatch' && inputs.channel == 'latest'
|
||||||
run: npm publish --tag latest --provenance
|
run: npm publish --tag latest --provenance
|
||||||
env:
|
env:
|
||||||
|
NPM_CONFIG_USERCONFIG: /dev/null
|
||||||
NODE_AUTH_TOKEN: ""
|
NODE_AUTH_TOKEN: ""
|
||||||
|
|
||||||
- name: Print npm debug logs
|
- name: Print npm debug logs
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue