Repository navigation
93 lines (83 loc) · 2.53 KB
/
Copy pathcodeql.yml
File metadata and controls
93 lines (83 loc) · 2.53 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
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: 🔒 CodeQL Security Analysis
on:
push:
branches:
- develop
- beta
- master
paths-ignore:
- '**/*.md'
- 'docs/**'
pull_request:
branches:
- develop
- beta
- master
paths-ignore:
- '**/*.md'
- 'docs/**'
schedule:
# Run weekly on Friday at 7:50 AM UTC
- cron: '50 7 * * 5'
permissions:
contents: read
concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
contents: read
security-events: write
actions: read
strategy:
fail-fast: false
matrix:
language:
- rust
- actions
steps:
- name: Checkout
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- name: Initialize CodeQL
uses: github/codeql-action/init@fe4161a26a8629af62121b670040955b330f9af2 # v4.31.6
with:
languages: ${{ matrix.language }}
queries: +security-and-quality
# Rust requires building the project
- name: Install Rust toolchain
if: matrix.language == 'rust'
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
with:
toolchain: stable
- name: Build Rust project
if: matrix.language == 'rust'
run: cargo build --release
env:
# Provide build-time env vars to prevent build errors
BUILD_COMMIT: ${{ github.sha }}
BUILD_DATE: ${{ github.event.head_commit.timestamp }}
BUILD_BRANCH: ${{ github.ref_name }}
- name: Autobuild
if: matrix.language != 'rust'
uses: github/codeql-action/autobuild@fe4161a26a8629af62121b670040955b330f9af2 # v4.31.6
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@fe4161a26a8629af62121b670040955b330f9af2 # v4.31.6
with:
category: '/language:${{ matrix.language }}'
upload: true
output: sarif-results
- name: Upload SARIF as artifact
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
if: always()
with:
name: codeql-sarif-${{ matrix.language }}
path: sarif-results/${{ matrix.language }}.sarif
retention-days: 7