-
Notifications
You must be signed in to change notification settings - Fork 7
59 lines (52 loc) · 1.89 KB
/
Copy pathcodeql.yml
File metadata and controls
59 lines (52 loc) · 1.89 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
name: CodeQL
# Advanced setup replacing GitHub's DEFAULT setup, which never analyzes fork
# pull requests — while `Analyze (actions)` / `Analyze (python)` are required
# contexts in branch protection, so every fork PR sat at BLOCKED with all
# visible gates green (#237). A workflow runs on fork PRs like any other
# (subject to the usual once-per-push approval), and its check runs carry the
# same names the protection requires: the job below is called Analyze and the
# matrix expands it to exactly those two contexts.
#
# Mirrors the default setup it replaces: languages actions + python, the
# extended query suite, a weekly schedule. Default setup must stay DISABLED in
# the repo settings — with it enabled, GitHub refuses SARIF uploads from
# advanced configurations.
on:
push:
branches: [main]
pull_request:
branches: [main]
merge_group:
schedule:
- cron: '30 4 * * 1'
permissions: {}
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [actions, python]
steps:
- name: Harden Runner
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Initialize CodeQL
uses: github/codeql-action/init@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
with:
languages: ${{ matrix.language }}
build-mode: none
queries: security-extended
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
with:
category: "/language:${{ matrix.language }}"