Skip to content

Commit 6079294

Browse files
committed
Enable codeql
1 parent 58bd35d commit 6079294

File tree

1 file changed

+18
-32
lines changed

1 file changed

+18
-32
lines changed

.github/workflows/codeql.yml

Lines changed: 18 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,31 @@
22
# 🔍 CodeQL Advanced – Multi-Language Static Analysis Workflow
33
# ===============================================================
44
#
5-
# This workflow:
6-
# • Scans JavaScript/TypeScript, Python, and GitHub Actions workflows
7-
# • Detects security vulnerabilities & code-quality issues with CodeQL
8-
# • Uploads SARIF results to the “Code scanning” tab
9-
# • Caches databases & dependencies to speed up re-runs
10-
# • Runs on every push/PR to `main` and weekly (Wed 21:15 UTC)
5+
# Scans JavaScript/TypeScript, Python, and GitHub Actions workflows.
6+
# Skips files in tests/, docs/, scripts/dev/ (see the config file).
117
# ---------------------------------------------------------------
128

139
name: CodeQL Advanced
1410

1511
on:
1612
push:
1713
branches: [ "main" ]
14+
paths-ignore:
15+
- '**/tests/**'
16+
- '**/docs/**'
1817
pull_request:
1918
branches: [ "main" ]
19+
paths-ignore:
20+
- '**/tests/**'
21+
- '**/docs/**'
2022
schedule:
2123
- cron: '15 21 * * 3' # Wednesday @ 21:15 UTC
2224

23-
# -----------------------------------------------------------------
24-
# Minimal permissions – principle of least privilege
25-
# -----------------------------------------------------------------
2625
permissions:
27-
contents: read # checkout
28-
security-events: write # upload SARIF
29-
actions: read # needed in private repos
30-
packages: read # download query packs
26+
contents: read
27+
security-events: write
28+
actions: read
29+
packages: read
3130

3231
jobs:
3332
analyze:
@@ -46,15 +45,10 @@ jobs:
4645
build: none
4746

4847
steps:
49-
# -------------------------------------------------------------
50-
# 0️⃣ Checkout source
51-
# -------------------------------------------------------------
52-
- name: ⬇️ Checkout code
48+
- name: ⬇️ Checkout code
5349
uses: actions/checkout@v4
5450

55-
# -------------------------------------------------------------
56-
# 1️⃣ Optional runtimes (harmless for interpreted languages)
57-
# -------------------------------------------------------------
51+
# Optional runtimes
5852
- name: 🐍 Setup Python
5953
if: matrix.language == 'python'
6054
uses: actions/setup-python@v5
@@ -67,30 +61,22 @@ jobs:
6761
with:
6862
node-version: '20'
6963

70-
# -------------------------------------------------------------
71-
# 2️⃣ Initialize CodeQL
72-
# -------------------------------------------------------------
64+
# Initialize CodeQL with external config file
7365
- name: 🛠️ Initialize CodeQL
7466
uses: github/codeql-action/init@v3
7567
with:
7668
languages: ${{ matrix.language }}
7769
dependency-caching: true
78-
# NOTE: Comma-separated list — no "+" prefix needed
79-
queries: security-extended,security-and-quality
70+
config-file: ./.github/codeql-config.yml # ← points to the file above
8071

81-
# -------------------------------------------------------------
82-
# 3️⃣ Manual build placeholder (not required here)
83-
# -------------------------------------------------------------
72+
# Placeholder build step if you ever need manual builds
8473
- if: matrix.build == 'manual'
85-
name: ⚙️ Manual build (placeholder)
74+
name: ⚙️ Manual build
8675
shell: bash
8776
run: |
8877
echo "Add build commands here for compiled languages."
8978
exit 1
9079
91-
# -------------------------------------------------------------
92-
# 4️⃣ Perform CodeQL analysis
93-
# -------------------------------------------------------------
9480
- name: 🔬 Perform CodeQL analysis
9581
uses: github/codeql-action/analyze@v3
9682
with:

0 commit comments

Comments
 (0)