Skip to content

Commit f9c91ce

Browse files
committed
ci(publish): add debug logging and environment cleanup for npm publish
Add debug logging to show npm config before and after cleanup, and clear environment variables that might interfere with OIDC authentication during npm publish operations. 调试日志记录和 npm 发布的环境清理 添加调试日志以显示清理前后的 npm 配置, 并清除可能干扰 npm 发布过程中 OIDC 身份验证的环境变量。 Change-Id: I04760aab0d756dc6fa39345342317d342d3bf6f3 Signed-off-by: OhYee <[email protected]>
1 parent f81de5d commit f9c91ce

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

.github/workflows/publish.yaml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,19 +125,25 @@ jobs:
125125
VERSION="${{ steps.version.outputs.VERSION }}"
126126
echo "Publishing ${PACKAGE_NAME}@${VERSION} with tag=test"
127127
128+
# Debug: show npm config (before cleanup)
129+
echo "=== npm config (before) ==="
130+
npm config list
131+
128132
# Remove any .npmrc that might interfere with OIDC
129133
rm -f ~/.npmrc
130134
rm -f .npmrc
131135
rm -f /home/runner/work/_temp/.npmrc
132136
133-
# Debug: show npm config
134-
echo "=== npm config ==="
137+
# Debug: show npm config (after cleanup)
138+
echo "=== npm config (after) ==="
135139
npm config list
136-
echo "=== npm version ==="
137-
npm --version
138140
139141
# Publish using Trusted Publishers (OIDC)
140142
npm publish --tag test --access public --provenance
143+
env:
144+
# Clear the environment variables that might interfere with OIDC
145+
NPM_CONFIG_USERCONFIG: ''
146+
NODE_AUTH_TOKEN: ''
141147

142148
- name: Summary
143149
run: |
@@ -283,6 +289,10 @@ jobs:
283289
284290
# Publish using Trusted Publishers (OIDC)
285291
npm publish --tag latest --access public --provenance
292+
env:
293+
# Clear the environment variables that might interfere with OIDC
294+
NPM_CONFIG_USERCONFIG: ''
295+
NODE_AUTH_TOKEN: ''
286296

287297
- name: Summary
288298
run: |
@@ -376,6 +386,10 @@ jobs:
376386
377387
# Publish using Trusted Publishers (OIDC)
378388
npm publish --tag test --access public --provenance
389+
env:
390+
# Clear the environment variables that might interfere with OIDC
391+
NPM_CONFIG_USERCONFIG: ''
392+
NODE_AUTH_TOKEN: ''
379393

380394
- name: Summary
381395
run: |

0 commit comments

Comments
 (0)