-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (61 loc) · 2.78 KB
/
Copy pathcodeql.yml
File metadata and controls
66 lines (61 loc) · 2.78 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
# ── PRIVATE REPOS: REMOVE THIS WORKFLOW ────────────────────────────────────────
# CodeQL requires GitHub Advanced Security. On a private repository without
# Advanced Security enabled, this workflow will fail with a 403 error.
# Delete this file from any private project repository.
# Keep it only for public repos or private repos with Advanced Security enabled.
# ───────────────────────────────────────────────────────────────────────────────
# CodeQL static analysis.
#
# Action versions were verified against GitHub and pinned to commit SHAs
# on 2026-05-30. The version tag is in the trailing comment.
#
# CodeQL does not support PHP, and on a free GitHub account it is not
# available for a private repository. This workflow covers JavaScript for
# a public static project. For a private PHP or WordPress project, remove
# this workflow and rely on the Semgrep job in security.yml instead.
#
# Language selection is archetype-aware: a project whose .github/ci-archetype
# declares python-tool has no JavaScript at all, so CodeQL's "Initialise"
# step analyses Python instead. Every other archetype keeps the existing
# JavaScript default. A hardcoded "languages: javascript" would silently
# analyse nothing in a Python-only repository — a false-green signal, not
# real coverage, which is the defect this gate closes. See
# jacob-ci-archetypes.md and docs/decisions/001-python-tool-ci-archetype.md
# in Lire RSS Hermes.
name: CodeQL
on:
push:
branches: [main]
schedule:
- cron: '0 6 * * 1' # weekly, Monday morning
permissions:
actions: read
contents: read
security-events: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check the CI archetype
id: archetype
run: |
if [ -f .github/ci-archetype ]; then
value=$(tr -d '[:space:]' < .github/ci-archetype)
else
value=""
fi
if [ "$value" = "python-tool" ]; then
echo "codeql_language=python" >> "$GITHUB_OUTPUT"
else
echo "codeql_language=javascript" >> "$GITHUB_OUTPUT"
fi
- name: Initialise CodeQL
uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
with:
languages: ${{ steps.archetype.outputs.codeql_language }}
- name: Analyse
uses: github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0