-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (80 loc) · 2.34 KB
/
Copy pathcodeql.yml
File metadata and controls
91 lines (80 loc) · 2.34 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
name: CodeQL
on:
push:
branches: [main]
paths:
- "Cargo.toml"
- "Cargo.lock"
- "src/**"
- "migrations/**"
- "tests/**"
- ".github/workflows/**"
pull_request:
branches: [main]
paths:
- "Cargo.toml"
- "Cargo.lock"
- "src/**"
- "migrations/**"
- "tests/**"
- ".github/workflows/**"
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-latest
timeout-minutes: 15
permissions:
security-events: write
packages: read
actions: read
contents: read
steps:
- uses: actions/checkout@v7.0.1
- uses: github/codeql-action/init@v4
with:
languages: actions
build-mode: none
queries: security-extended
- uses: github/codeql-action/analyze@v4
with:
category: "/language:actions"
analyze-rust:
name: Analyze (rust)
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
security-events: write
packages: read
actions: read
contents: read
steps:
- uses: actions/checkout@v7.0.1
- uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # 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@v4
with:
languages: rust
build-mode: none
queries: security-extended
config: |
paths-ignore:
- 'target/**'
- uses: github/codeql-action/analyze@v4
with:
category: "/language:rust"