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
# GitHub's semantic code-scanning (SAST). Results land in the Security tab.
#
# ── RUNNER / COST TRADEOFF ────────────────────────────────────────────────────
# CodeQL is DESIGNED FOR GITHUB-HOSTED runners (the Actions bundle ships the
# CodeQL CLI + query packs; the self-hosted CI VM does not). So this workflow
# uses `ubuntu-latest`, NOT the self-hosted runner.
#
# * While the repo is PRIVATE, GitHub-hosted runs consume Actions minutes.
# * Once the repo is PUBLIC, GitHub-hosted Actions (and code scanning) are
# FREE — this is the intended steady state for the OSS release.
#
# To bound private-repo spend we DON'T run on every PR: it runs on push to the
# default branch (`main`) and on a weekly schedule. Flip to `pull_request:` for
# per-PR scanning once public (it's free then). See .github/workflows/README.md.
#
# ── LANGUAGES ─────────────────────────────────────────────────────────────────
# * javascript-typescript — the OAuth sidecar (oauth-sidecar/).
# * rust — DROPPED: CodeQL's Rust extractor (public beta) errored on ALL source
# files here (0 extracted OK / 11 with errors), producing no usable analysis.
# Rust is covered by clippy (-D warnings) + cargo-deny + cargo-audit. Re-add
# the `rust` matrix entry once GitHub GA's a working Rust pack.
on:
push:
branches:
schedule:
- cron: "27 4 * * 1" # Mondays 04:27 UTC — weekly deep scan
workflow_dispatch:
concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Code scanning needs GitHub Advanced Security on a PRIVATE repo, so the SARIF
# upload fails while private. Skip until the repo is public (free + enabled then).
if: ${{ github.event.repository.private == false }}
runs-on: ubuntu-latest # GitHub-hosted: free once public; see header note
permissions:
actions: read
contents: read
security-events: write # upload SARIF to the Security tab
strategy:
fail-fast: false
matrix:
language: # rust dropped — see header (extractor beta errors on all files)
steps:
- uses: actions/checkout@v7
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
# `security-and-quality` = the broader query suite (security + code
# quality), a good default for a new OSS project.
queries: security-and-quality
# Rust + TypeScript are both no-build (CodeQL extracts from source /
# autobuilds). If the Rust extractor ever needs a real build, replace this
# with an explicit `cargo build` step guarded on matrix.language == rust.
- name: Autobuild
uses: github/codeql-action/autobuild@v4
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"