Repository navigation
71 lines (66 loc) · 2.16 KB
/
Copy pathcodeql.yml
File metadata and controls
71 lines (66 loc) · 2.16 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
name: CodeQL
"on":
pull_request:
branches: [main]
paths: ['src/**', 'xtask/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/**']
merge_group:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
selection:
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
contents: read
pull-requests: read
outputs:
languages: ${{ steps.changes.outputs.changes }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
id: changes
with:
base: ${{ github.event.merge_group.base_sha || github.event.repository.default_branch }}
filters: |
rust:
- 'src/**'
- 'xtask/**'
- 'Cargo.{toml,lock}'
- '.github/workflows/codeql.yml'
actions:
- '.github/workflows/**'
analyze:
name: Analyze (${{ matrix.language }})
needs: [selection]
if: needs.selection.outputs.languages != '[]'
runs-on: ${{ matrix.language == 'rust' && 'windows-2022' || 'ubuntu-24.04' }}
timeout-minutes: 45
permissions:
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ${{ fromJSON(needs.selection.outputs.languages) }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- if: matrix.language == 'rust'
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
with:
toolchain: "1.99.1"
- uses: github/codeql-action/init@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
with:
languages: ${{ matrix.language }}
build-mode: none
queries: security-extended
- uses: github/codeql-action/analyze@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
with:
category: /language:${{ matrix.language }}