-
Notifications
You must be signed in to change notification settings - Fork 62
72 lines (62 loc) · 2.4 KB
/
codeql.yml
File metadata and controls
72 lines (62 loc) · 2.4 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
name: CodeQL
on:
pull_request:
branches: [main]
# Skip CodeQL on doc-only PRs — analyzing C++ requires building the
# whole project (~23 min wall clock). The weekly cron below gives
# us a periodic full scan regardless of PR activity.
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSE'
- '.gitignore'
- '.github/**'
# Post-merge guard — paired with ci.yml's push:main trigger; same
# paths-ignore rules apply so docs/CI-only merges don't burn 23 min.
push:
branches: [main]
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSE'
- '.gitignore'
- '.github/**'
schedule:
- cron: '0 6 * * 1' # weekly Monday 06:00 UTC
# Workflow-level least-privilege GITHUB_TOKEN. CodeQL's official guidance
# (https://github.com/github/codeql-action#permissions) is:
# actions: read — needed by the CodeQL action to inspect this
# workflow's metadata for category info.
# contents: read — needed by actions/checkout to fetch the repo.
# security-events: write — needed by the analyze step to upload SARIF.
# Previously the block sat at job level and declared only
# `security-events: write`, which (per GitHub's "specify any → unspecified
# default to none" rule) dropped contents and actions to none. It worked
# only because the repo is public; tightening to documented scopes makes
# the intent explicit and survives a hypothetical visibility change.
permissions:
actions: read
contents: read
security-events: write
jobs:
analyze:
runs-on: ubuntu-latest
container: ghcr.io/ten9876/aethersdr-ci:latest
strategy:
matrix:
language: [cpp]
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Fix git ownership for container
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Initialize CodeQL
uses: github/codeql-action/init@7c1e4cf0b20d7c1872b26569c00ba908797a59bf # v4
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
- name: Configure
run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
- name: Build
run: cmake --build build -j$(nproc)
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@7c1e4cf0b20d7c1872b26569c00ba908797a59bf # v4