Skip to content

Commit 0028656

Browse files
author
dompling
committed
fix
1 parent 07f3623 commit 0028656

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ jobs:
9393
# 发布 NPM 包(仅在 API 有变化时)
9494
- name: Publish NPM Package
9595
if: success() && steps.check_api.outputs.api_changed == 'true'
96+
continue-on-error: true
9697
env:
9798
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
9899
run: |
@@ -108,8 +109,15 @@ jobs:
108109
109110
cd npm
110111
echo "📦 Publishing to NPM..."
111-
npm publish --access public
112-
echo "✅ Published successfully"
112+
113+
# 尝试发布,捕获错误但不中断工作流
114+
if npm publish --access public 2>&1; then
115+
echo "✅ Published successfully"
116+
else
117+
echo "⚠️ NPM publish failed (version may already exist or token issue)"
118+
echo "ℹ️ Continuing workflow..."
119+
exit 0
120+
fi
113121
114122
# 4. 复制私有仓库的文件到当前仓库
115123
- name: Copy files from Private Repository

0 commit comments

Comments
 (0)