Repository navigation
71 lines (63 loc) · 2.56 KB
/
Copy pathcodeql.yml
File metadata and controls
71 lines (63 loc) · 2.56 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
67
68
69
70
71
name: CodeQL
# Static security + quality analysis (GitHub CodeQL, advanced setup).
#
# This is intentionally a SEPARATE workflow from ci.yml and is NON-GATING:
# * The repo has no branch protection, so nothing blocks a merge on it.
# * The prod deploy in ci.yml gates only on `backend-tests`, not on this job.
# Its purpose is to surface findings in the repo's Security > Code scanning tab
# (the repo had no code scanning before this) — not to add a merge hurdle.
#
# Advanced setup (this file) is mutually exclusive with CodeQL "default setup"
# in the Security tab UI: enabling default setup there would DISABLE this
# workflow. Manage the scan here, in version control.
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# Weekly re-scan (Mondays 06:31 UTC) so newly-published CodeQL queries
# run against existing code, not only against new commits.
- cron: "31 6 * * 1"
# Manual re-run — e.g. after narrowing the query suite in codeql-config.yml —
# without having to push an empty commit.
workflow_dispatch:
# Cancel a superseded run only on pull requests (github.ref = refs/pull/N/merge);
# pushes to main keep every commit's scan, since code-scanning results are
# tracked per-commit on the default branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
security-events: write # upload SARIF results to code scanning
packages: read # download the CodeQL query packs
actions: read # required on private repos; harmless on public
contents: read # checkout
strategy:
fail-fast: false
matrix:
include:
# Python is the dominant surface (backend, orchestration, SDK).
- language: python
build-mode: none
# Hand-written frontend JS (some with XSS history) + the React/TS
# landing source. build-mode: none = analyze source directly.
- language: javascript-typescript
build-mode: none
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
config-file: ./.github/codeql/codeql-config.yml
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"