-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (81 loc) · 2.51 KB
/
Copy pathcodeql.yml
File metadata and controls
91 lines (81 loc) · 2.51 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
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: 🔒 CodeQL Security Analysis
on:
push:
branches:
- develop
- master
paths-ignore:
- '**/*.md'
- 'docs/**'
pull_request:
branches:
- develop
- 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Initialize CodeQL
uses: github/codeql-action/init@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v4.33.0
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@150fca883cd4034361b621bd4e6a9d34e5143606 # 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@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v4.33.0
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v4.33.0
with:
category: '/language:${{ matrix.language }}'
upload: true
output: sarif-results
- name: Upload SARIF as artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
if: always()
with:
name: codeql-sarif-${{ matrix.language }}
path: sarif-results/${{ matrix.language }}.sarif
retention-days: 7