x修复工作流

This commit is contained in:
xuncha
2026-04-07 22:58:41 +08:00
parent 73ee524d1f
commit dcad30bc39

View File

@@ -1,5 +1,8 @@
name: Security Scan name: Security Scan
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
on: on:
schedule: schedule:
- cron: '0 2 * * *' # 每天 UTC 02:00 - cron: '0 2 * * *' # 每天 UTC 02:00
@@ -24,15 +27,15 @@ jobs:
steps: steps:
- name: Checkout ${{ matrix.branch }} - name: Checkout ${{ matrix.branch }}
uses: actions/checkout@v4 uses: actions/checkout@v5
with: with:
ref: ${{ matrix.branch }} ref: ${{ matrix.branch }}
fetch-depth: 0 fetch-depth: 0
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v5
with: with:
node-version: '20' node-version: '24'
cache: 'npm' # 使用 npm 缓存加速 cache: 'npm' # 使用 npm 缓存加速
- name: Install dependencies - name: Install dependencies
@@ -71,10 +74,16 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v4 uses: actions/checkout@v5
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: '24'
cache: 'npm'
- name: Run npm audit on all branches - name: Run npm audit on all branches
run: | run: |
git branch -r | grep -v HEAD | sed 's|origin/||' | tr -d ' ' | while read branch; do git branch -r | grep -v HEAD | sed 's|origin/||' | tr -d ' ' | while read branch; do
@@ -84,4 +93,4 @@ jobs:
npm ci --ignore-scripts --silent 2>/dev/null || npm install --ignore-scripts --silent 2>/dev/null || true npm ci --ignore-scripts --silent 2>/dev/null || npm install --ignore-scripts --silent 2>/dev/null || true
npm audit --audit-level=moderate 2>/dev/null || true npm audit --audit-level=moderate 2>/dev/null || true
done done
continue-on-error: true continue-on-error: true