Skip to content

Commit a3ab620

Browse files
zeevdrclaude
andauthored
ci: add CodeQL advanced setup workflow (#190)
Replaces default-setup. Advanced unlocks paths-ignore for generated code (api/centralconfig/v1, internal/storage/dbstore/*.gen.go) and Go module caching across runs — projected ~1-2 min faster vs default-setup. Matches default-setup's `default` query suite and `remote` threat model for findings parity. Languages: actions, go, python. Default-setup must be disabled in repo settings post-merge for this workflow's uploads to take effect. Refs #183 Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d826412 commit a3ab620

1 file changed

Lines changed: 73 additions & 0 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# CodeQL advanced setup. Replaces default-setup once disabled in repo settings.
2+
# Advanced unlocks paths-ignore (skip generated code) and Go module caching
3+
# across runs — projected ~1-2 min faster vs default-setup.
4+
name: CodeQL
5+
6+
on:
7+
pull_request:
8+
branches: [main]
9+
paths-ignore:
10+
- "api/centralconfig/v1/**"
11+
- "internal/storage/dbstore/*.gen.go"
12+
- "**/*.md"
13+
push:
14+
branches: [main]
15+
schedule:
16+
- cron: "23 7 * * 1"
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
20+
cancel-in-progress: true
21+
22+
permissions:
23+
contents: read
24+
25+
jobs:
26+
analyze:
27+
name: Analyze (${{ matrix.language }})
28+
runs-on: ubuntu-latest
29+
timeout-minutes: 15
30+
permissions:
31+
security-events: write
32+
packages: read
33+
actions: read
34+
contents: read
35+
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
include:
40+
- language: actions
41+
build-mode: none
42+
- language: go
43+
build-mode: autobuild
44+
- language: python
45+
build-mode: none
46+
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v4
50+
with:
51+
persist-credentials: false
52+
53+
- name: Set up Go
54+
if: matrix.language == 'go'
55+
uses: actions/setup-go@v5
56+
with:
57+
go-version-file: go.mod
58+
cache: true
59+
60+
- name: Initialize CodeQL
61+
uses: github/codeql-action/init@v3
62+
with:
63+
languages: ${{ matrix.language }}
64+
build-mode: ${{ matrix.build-mode }}
65+
config: |
66+
paths-ignore:
67+
- api/centralconfig/v1/**
68+
- internal/storage/dbstore/*.gen.go
69+
70+
- name: Analyze
71+
uses: github/codeql-action/analyze@v3
72+
with:
73+
category: "/language:${{ matrix.language }}"

0 commit comments

Comments
 (0)