Repository navigation
89 lines (78 loc) · 2.82 KB
/
Copy pathcodeql.yml
File metadata and controls
89 lines (78 loc) · 2.82 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
name: CodeQL
on:
push:
branches: [main]
paths:
- "Cargo.toml"
- "Cargo.lock"
- "src/**"
- "migrations-v2/**"
- "tests/**"
- ".github/workflows/**"
# Every pull request, with no path filter. The ruleset on `main` requires a
# CodeQL result, and a filtered run never comes for a branch that touches
# only `webapp/` or `docs/`: such a PR finished green and still BLOCKED,
# waiting for an analysis nothing would start. On those the analysis finds
# nothing new, which is the answer the requirement is waiting for.
pull_request:
branches: [main]
schedule:
- cron: "34 7 * * 4"
concurrency:
group: codeql-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# `actions` analysis runs the CodeQL queries that catch script-
# injection patterns in workflow files themselves. Always-on, cheap.
analyze-actions:
name: Analyze (actions)
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
security-events: write
packages: read
actions: read
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: github/codeql-action/init@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4
with:
languages: actions
build-mode: none
queries: security-extended
- uses: github/codeql-action/analyze@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4
with:
category: "/language:actions"
analyze-rust:
name: Analyze (rust)
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
security-events: write
packages: read
actions: read
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
# Pre-fetch the full dep graph so CodeQL's internal `cargo metadata`
# invocations resolve every transitive crate without hitting the
# registry mid-extraction. The Rust extractor is preview-only and
# rejects build-mode=manual, so this is the main lever we have to
# push call-target resolution above the 50 % threshold.
- name: cargo fetch
run: cargo fetch --locked
- uses: github/codeql-action/init@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4
with:
languages: rust
build-mode: none
queries: security-extended
config: |
paths-ignore:
- 'target/**'
- uses: github/codeql-action/analyze@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4
with:
category: "/language:rust"