-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (56 loc) · 2.17 KB
/
Copy pathquality.yml
File metadata and controls
62 lines (56 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Quality Gates
# Heavy quality checks for the release PR (develop / work branch → main).
# Fast per-task gates live in verify-build.yml (build + lint + tests).
#
# NOTE: this is a PRIVATE repo without GitHub Advanced Security, so CodeQL
# (code scanning) and actions/dependency-review-action are unavailable —
# both hard-fail with "not enabled for this repository". If the repo ever
# goes public (or GHAS is purchased), re-add them; until then `npm audit`
# covers the vulnerable-dependency gate.
on:
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pull-requests: write
jobs:
# -------- npm audit: blocks known-vulnerable deps (high/critical) --------
npm-audit:
name: npm audit (high+)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with: { node-version: '22' }
- name: Audit production and dev dependencies
run: npm audit --audit-level=high
# -------- Secret Scanning: documents repo-level enablement --------
# Real scanning runs at the repo settings level (GH Advanced Security or public repo).
# This job only verifies the alerts API is reachable — it does not scan content.
secret-scanning-check:
name: Secret Scanning Status
runs-on: ubuntu-latest
steps:
- name: Verify secret-scanning API reachable
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
status=$(gh api -i "repos/${{ github.repository }}/secret-scanning/alerts" --silent -q '.' 2>&1 | head -1 || true)
if echo "$status" | grep -q "404"; then
echo "::warning::Secret scanning not enabled. Enable at Settings → Code security."
else
echo "Secret scanning API reachable."
fi
# -------- Aggregate: single required check for branch protection --------
required-status-summary:
name: Quality gate
runs-on: ubuntu-latest
needs: [npm-audit]
if: always()
steps:
- name: Verify all upstream jobs succeeded
run: |
if [[ "${{ needs.npm-audit.result }}" != "success" ]]; then exit 1; fi
echo "All quality gates passed."