-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (54 loc) · 1.72 KB
/
Copy pathcodeql.yml
File metadata and controls
66 lines (54 loc) · 1.72 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
# CodeQL security analysis for Rust
#
# Runs on push to main/releases and weekly on Sunday.
# Uses build-mode: none to avoid a full Rust compilation (saves disk space).
# Results appear in the GitHub Security tab and do NOT block PR merges.
name: CodeQL
on:
push:
branches:
- main
- 'releases/*'
schedule:
- cron: "0 3 * * 0"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
analyze:
name: Analyze Rust
runs-on: ubuntu-latest
timeout-minutes: 120
permissions:
security-events: write
packages: read
actions: read
contents: read
steps:
- name: Harden the runner
uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Setup environment
uses: ./.github/actions/setup-environment
- name: Initialize CodeQL
uses: github/codeql-action/init@adfda868f108ac4222129de456ea554034a27db7 # v4
with:
languages: rust
# build-mode: none uses rust-analyzer instead of a full compile —
# dramatically reduces disk space and build time.
build-mode: none
queries: security-extended
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@adfda868f108ac4222129de456ea554034a27db7 # v4
with:
category: "/language:rust"
upload: always
- name: Cleanup CodeQL database
if: always()
run: rm -rf "${{ runner.temp }}/codeql_databases" || true