-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (83 loc) · 3.43 KB
/
Copy pathcodeql.yml
File metadata and controls
93 lines (83 loc) · 3.43 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
name: "CodeQL Advanced"
# Deny-by-default at the workflow level. Every job below already declares the
# narrow set it needs, so this changes no current behaviour -- it changes what
# happens NEXT: a job added later without its own permissions block inherits
# this empty set and fails closed, instead of silently inheriting whatever the
# repository default happens to be. The other 16 workflows already carry a
# top-level block; this brings the last five in line.
permissions: {}
on:
push:
branches: ["main"]
paths-ignore:
- "docs/**"
- ".github/**"
- ".workflow/**"
- ".claude/**"
- "tests/**"
pull_request:
branches: ["main"]
schedule:
- cron: '34 15 * * 1'
workflow_dispatch:
jobs:
analyze:
concurrency:
group: codeql-${{ github.workflow }}-${{ github.ref }}
# Exempt main so every commit landed on main keeps a complete scan history;
# superseded runs on other refs are cancelled to save CI minutes (matches
# the cancel-in-progress policy used across the other workflows).
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
security-events: write
contents: read
packages: read
strategy:
fail-fast: false
matrix:
include:
- language: python
build-mode: none
# Add other language entries only if your repo contains them.
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Python (used for analysis runtime / import resolution)
if: matrix.language == 'python'
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.12' # match the project's CI target (CLAUDE.md); avoid floating 3.x
# Install deps only when build-mode is manual (CodeQL needs to trace the build)
- name: Install dependencies
if: matrix.language == 'python' && matrix['build-mode'] == 'manual'
run: |
python -m pip install --upgrade "pip==26.1.2"
pip install -r requirements.txt -c constraints.txt
- name: Initialize CodeQL
uses: github/codeql-action/init@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# Query suite and query-filters both live in the config file now --
# query-filters (used to exclude the documented false-positive
# py/file-not-closed finding on utils/logger.py's intentionally
# long-lived audit handle) require a config file, so the previously
# inline `queries: security-and-quality` moved there too rather than
# splitting the query configuration across two places.
config-file: ./.github/codeql/codeql-config.yml
- name: Run manual build steps
if: matrix.build-mode == 'manual'
shell: bash
run: |
echo "Replace this with your build commands (make, mvn, dotnet build, etc.)"
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4
with:
category: "/language:${{ matrix.language }}"