feat(ci): add npm audit (high) to frontend-lint job (warning mode)
Tests / test (pull_request) Failing after 0s
Tests / lint (pull_request) Failing after 0s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Successful in 57s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 2m47s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped

This commit is contained in:
2026-07-13 15:20:52 +08:00
parent a9d5af63be
commit 53c31d435d
+22
View File
@@ -266,6 +266,28 @@ jobs:
-w /workspace/apps/web \
docker.m.daocloud.io/library/node:20 \
sh -lc 'npx vitest run src/test'
- name: Run npm audit (high severity)
continue-on-error: true
shell: sh
run: |
set +e
echo "=== npm audit 检查 (high 级别及以上) ==="
docker run --rm \
-v "$PWD:/workspace" \
-w /workspace/apps/web \
docker.m.daocloud.io/library/node:20 \
sh -lc 'npm audit --audit-level=high'
AUDIT_EXIT=$?
if [ "$AUDIT_EXIT" -ne 0 ]; then
echo ""
echo "⚠️ npm audit 发现 high 级别漏洞,请关注(当前为告警模式,不阻断 CI)"
echo "建议后续根据存量漏洞情况决定是否设置为阻断"
else
echo "✅ npm audit 未发现 high 级别漏洞"
fi
exit 0
deploy-staging:
name: Build & Push Staging (Watchtower auto-deploy)
runs-on: saas