Files
cieanyau 65c175c8fa
前端验证 / verify (push) Successful in 1m24s
精简公开仓库说明与测试资料
2026-11-07 11:48:31 +08:00

36 lines
1.3 KiB
YAML

# 仅做前端验证,不包含发布、服务器登录或生产凭证。
name: 前端验证
on:
push:
pull_request:
jobs:
verify:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: 获取源码
# Runner 所在网络访问 github.com 不稳定;使用 git.crash.work 上的副本(手动从 GitHub 推送更新)。
uses: https://git.crash.work/actions/checkout@v4
with:
persist-credentials: false
# Runner 位于中国大陆,ubuntu-latest 映射到自带 Node 22 的 node:22-bookworm-slim 镜像;
# 不再用 setup-node 从 GitHub 下载 Node(经常超时),只校验镜像内版本。
- name: 确认 Node.js
run: |
node -v
node -e 'if (Number(process.versions.node.split(".")[0]) !== 22) { console.error("需要 Node 22"); process.exit(1) }'
- name: 安装锁定依赖
run: npm ci
- name: 检查代码和格式
run: |
npm run lint
npm run format:check
- name: 检查源码并构建
run: |
npm run check
npm run build
# deepmerge 尚无上游修复版本;低危传播项保留在审计输出,不通过降级框架隐藏。
- name: 阻止中危及以上依赖风险
run: npm audit --audit-level=moderate