sub2api/.github/workflows/security-scan.yml
win 63d6d12baf
Some checks failed
CI / test (push) Failing after 8m18s
CI / frontend (push) Failing after 2m19s
CI / golangci-lint (push) Failing after 2s
Security Scan / backend-security (push) Failing after 1h56m25s
Security Scan / frontend-security (push) Failing after 51s
CI / windsurf-platform (windows-latest) (push) Has been cancelled
CI / windsurf-platform (macos-latest) (push) Has been cancelled
fix(ci): use Gitea-compatible actions refs
2026-06-01 11:53:08 +08:00

59 lines
1.5 KiB
YAML

name: Security Scan
on:
push:
pull_request:
schedule:
- cron: '0 3 * * 1'
permissions:
contents: read
jobs:
backend-security:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: backend/go.mod
check-latest: false
cache-dependency-path: backend/go.sum
- name: Verify Go version
run: |
go version | grep -q 'go1.26.2'
- name: Run govulncheck
working-directory: backend
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
frontend-security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'pnpm'
cache-dependency-path: frontend/pnpm-lock.yaml
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@9 --activate
- name: Install dependencies
working-directory: frontend
run: pnpm install --frozen-lockfile
- name: Run pnpm audit
working-directory: frontend
run: |
pnpm audit --prod --audit-level=high --json > audit.json || true
- name: Check audit exceptions
run: |
python tools/check_pnpm_audit_exceptions.py \
--audit frontend/audit.json \
--exceptions .github/audit-exceptions.yml