Repository navigation
113 lines (103 loc) · 3.33 KB
/
Copy pathcodeql.yml
File metadata and controls
113 lines (103 loc) · 3.33 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: CodeQL
# ---------------------------------------------------------------------------
# Noise control.
#
# The `security-and-quality` query suite is what produces most low-value
# findings (style, maintainability, "cyclic import" on deliberate lazy imports).
# It is worth running periodically over the whole tree; it is not worth putting
# in front of every pull request, where it buries the security findings that
# actually matter. So:
#
# pull_request -> `security-extended` (security only, still broad)
# push / schedule -> `security-and-quality` (full sweep on main)
#
# Triage evidence: of 19 CodeQL findings reviewed on PR #41, 1 was a real
# defect. The rest were quality-suite findings in files the PR merely touched.
# ---------------------------------------------------------------------------
on:
push:
branches: [ "main" ]
paths-ignore:
- "**/*.md"
- "docs/**"
- "archive/**"
- "ai-conversations/**"
- "media/**"
pull_request:
branches: [ "main" ]
paths-ignore:
- "**/*.md"
- "docs/**"
- "archive/**"
- "ai-conversations/**"
- "media/**"
merge_group:
types: [checks_requested]
schedule:
- cron: "34 17 * * 0"
workflow_dispatch:
# Without this, every push to a PR branch stacks another full 4-language matrix
# on top of the still-running one.
concurrency:
group: codeql-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
security-events: write
packages: read
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: javascript-typescript
build-mode: none
- language: python
build-mode: none
- language: rust
build-mode: none
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Select query suite
id: suite
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "queries=security-extended" >> "$GITHUB_OUTPUT"
else
echo "queries=security-and-quality" >> "$GITHUB_OUTPUT"
fi
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: ${{ steps.suite.outputs.queries }}
config: |
paths-ignore:
# Superseded canonical work. Never product code.
- archive/**
- ai-conversations/**
# Prose and raw intake, including any code fenced inside it.
- docs/**
# Vendored / generated / third-party.
- skill-corpus/**
- evals/**
- "**/node_modules/**"
- "**/target/**"
- "**/dist/**"
- "**/build/**"
- "**/venv/**"
- "**/.venv/**"
- "**/*.min.js"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"