-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (57 loc) · 2.44 KB
/
Copy pathcodeql.yml
File metadata and controls
64 lines (57 loc) · 2.44 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
name: CodeQL
# Shell and Dockerfiles have no CodeQL analyzer, so the analyzable surface in
# this repo is the GitHub Actions workflows themselves — CodeQL's `actions`
# support (GA since 2025-04) flags script injection, missing/over-broad
# permissions, unpinned actions and untrusted-input sinks in the workflows.
# Advanced setup: GitHub's "default" code-scanning setup must be OFF in repo
# settings (Settings → Code security → Code scanning → Advanced) or Analyze errors.
# Triggers are scoped to the ONLY paths this analysis reads (the `actions`
# language surface below + its config): a PR touching only shell scripts or the
# Dockerfile cannot produce different CodeQL results, and previously still ran a
# full ~1.5-3 min analysis. Safe because "CI Complete" (in ci.yml), not CodeQL,
# is the required branch-protection check — a skipped run can't deadlock merges.
# The weekly schedule still covers query-pack updates on an unchanged repo.
on:
push:
branches: [main]
paths:
- ".github/workflows/**"
- ".github/codeql/**"
pull_request:
branches: [main]
paths:
- ".github/workflows/**"
- ".github/codeql/**"
schedule:
- cron: "0 3 * * 1" # weekly, Monday 03:00 UTC — full scan even without code changes
# Cancel a superseded run when new commits land on the same ref, so rapid pushes
# don't queue overlapping CodeQL analyses (mirrors ci.yml). The weekly schedule runs
# on `main`, so its group key differs from PR refs and won't be cancelled by them.
concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: true
# Deny all permissions by default; each job opts in to only what it needs.
permissions: {}
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [actions]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
- name: Initialize CodeQL
uses: github/codeql-action/init@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4
with:
languages: ${{ matrix.language }}
# Actions workflows are declarative YAML — nothing to build.
build-mode: none
config-file: ./.github/codeql/codeql-config.yml
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4