-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (48 loc) · 1.74 KB
/
Copy pathcodeql.yml
File metadata and controls
58 lines (48 loc) · 1.74 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
name: CodeQL Analysis
# CodeQL is NOT a PR gate — it is too slow (5–15 min) to block developer feedback.
# Findings appear in the GitHub Security tab automatically.
# Runs:
# - Every push to main (catches anything that slipped through PR checks)
# - Weekly on Monday at 02:00 UTC (baseline drift detection)
on:
push:
branches: [main]
schedule:
- cron: '0 2 * * 1'
permissions:
contents: read
security-events: write
actions: read
jobs:
analyze:
name: CodeQL — JavaScript / TypeScript
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 22
# No cache: npm — package-lock.json is gitignored in this project.
# CodeQL needs installed dependencies to resolve imports properly.
- name: Install dependencies
run: npm install --ignore-scripts
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
# "javascript" covers both JS and TS — no need to list both.
languages: javascript
# security-and-quality includes OWASP Top 10 patterns.
queries: security-and-quality
# Let CodeQL auto-detect the build (TypeScript projects typically need no explicit step).
- name: Autobuild
uses: github/codeql-action/autobuild@v3
# continue-on-error: SARIF upload requires GitHub Advanced Security on private repos.
# The analysis itself still runs; findings are logged in the job output.
- name: Run CodeQL analysis
continue-on-error: true
uses: github/codeql-action/analyze@v3
with:
category: /language:javascript
upload: true