forked from ChelseaKR/sprout
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (50 loc) · 2.14 KB
/
Copy pathcodeql.yml
File metadata and controls
58 lines (50 loc) · 2.14 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
name: codeql
# Wires the CodeQL scanning claimed at docs/RESPONSIBLE-TECH-AUDITS.md:390/407, CLAUDE.md,
# and docs/ROADMAP.md:94 — added 2026-07-05 (audit P0-7) because those docs claimed CodeQL
# ran when no such workflow existed.
on:
# PRs into main + weekly schedule (CI-CD-STANDARD §11e); the redundant push: main
# trigger was dropped 2026-07-17 — the PR run already covers every merged commit.
pull_request:
branches: [main]
schedule:
- cron: "17 10 * * 1"
workflow_dispatch: {}
permissions:
contents: read
concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
analyze:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read # required on private repos: codeql-action reads its own workflow-run metadata
strategy:
fail-fast: false
matrix:
language: [python, actions]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Initialize CodeQL
uses: github/codeql-action/init@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7
with:
languages: ${{ matrix.language }}
# Code scanning is not enabled on this repository, so the SARIF-upload API is unavailable
# and `analyze` fails outright with "Code scanning is not enabled for this repository".
# Write the SARIF locally and gate on it ourselves instead — there is no code-scanning
# dashboard to review, so the gate step below IS the enforcement. Keep this arrangement
# until code scanning is actually turned on and the uploaded results are actually
# triaged; a dashboard nobody reads is weaker than a job that fails the build.
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7
with:
category: "/language:${{ matrix.language }}"
upload: never
output: sarif-results
- name: Fail on error-severity findings
run: python3 scripts/codeql_gate.py sarif-results