Repository navigation
56 lines (48 loc) · 1.79 KB
/
Copy pathcodeql.yml
File metadata and controls
56 lines (48 loc) · 1.79 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
name: CodeQL
# Static analysis via GitHub code scanning; results land in the repo's Security
# tab and as PR annotations. Runs on the same PR/main triggers as CI, plus a
# weekly schedule so new CodeQL queries reach code that hasn't changed.
# Separate from build.yml on purpose: it needs security-events: write, which the
# release pipeline shouldn't hold, and it doesn't use the Hatch toolchain.
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: "17 6 * * 1" # Mondays 06:17 UTC
workflow_dispatch:
concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write # upload SARIF results to code scanning
strategy:
fail-fast: false
matrix:
# python: src/ and scripts/, including the generated models (they ship).
# actions: the workflows themselves, which hold PyPI trusted publishing
# and release-creation rights.
language: ["python", "actions"]
steps:
- uses: actions/checkout@v5
# Pinned by commit (like mise-action in build.yml): it holds
# security-events: write. build-mode none: neither language needs a
# build or installed deps.
- name: Initialize CodeQL
uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
with:
languages: ${{ matrix.language }}
build-mode: none
queries: security-extended
- name: Analyze
uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
with:
category: "/language:${{ matrix.language }}"