Repository navigation
97 lines (86 loc) · 2.77 KB
/
Copy pathcodeql.yml
File metadata and controls
97 lines (86 loc) · 2.77 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# g8s CodeQL Deep Semantic SAST & Taint Analysis Workflow
#
# Performs inter-procedural dataflow and taint analysis across Go packages
# (trust boundaries: internal/receipt, internal/worker, internal/server,
# internal/harness, internal/memory, internal/dispatch) and GitHub Actions
# workflows. Honors ADR-0031 two-lane routing (early-exits on docs-only PRs).
name: CodeQL
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 3 * * 1' # Weekly Monday 03:00 UTC
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
security-events: write
packages: read
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: go
build-mode: autobuild
- language: actions
build-mode: none
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Detect CI Lane (ADR-0031)
shell: bash
run: |
if [ "${{ github.event_name }}" = "schedule" ]; then
CI_LANE="build"
else
BEFORE_SHA="${{ github.event.before }}"
lane=$(bash tools/ci_lane_detect.sh origin/main "$BEFORE_SHA" || true)
if [ "$lane" = "lane=docs" ] || [ "$lane" = "docs" ]; then
CI_LANE="docs"
else
CI_LANE="build"
fi
fi
echo "CI_LANE=$CI_LANE" >> "$GITHUB_ENV"
echo "Detected lane: $CI_LANE"
- name: Early exit for docs lane
if: env.CI_LANE == 'docs'
shell: bash
run: |
echo "::notice::docs lane: CodeQL (${{ matrix.language }}) skipped (not applicable)"
exit 0
- name: Setup Go
if: env.CI_LANE != 'docs' && matrix.language == 'go'
uses: actions/setup-go@v7
with:
go-version: '1.26.9'
- name: Initialize CodeQL
if: env.CI_LANE != 'docs'
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-extended
- name: Autobuild (Zero-CGO)
if: env.CI_LANE != 'docs' && matrix.build-mode == 'autobuild'
env:
CGO_ENABLED: '0'
uses: github/codeql-action/autobuild@v4
- name: Perform CodeQL Analysis
if: env.CI_LANE != 'docs'
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"