-
-
Notifications
You must be signed in to change notification settings - Fork 21
81 lines (76 loc) · 2.6 KB
/
Copy pathcodeql.yml
File metadata and controls
81 lines (76 loc) · 2.6 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
name: CodeQL
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: "17 4 * * 1"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
contents: read
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language:
- actions
- csharp
- javascript-typescript
- python
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup .NET
if: matrix.language == 'csharp'
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: 10.0.x
- name: Cache NuGet
if: matrix.language == 'csharp'
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-codeql-${{ hashFiles('**/*.csproj', '**/*.props', '**/global.json') }}
restore-keys: |
${{ runner.os }}-nuget-codeql-
${{ runner.os }}-nuget-
- name: Initialize CodeQL
uses: github/codeql-action/init@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4
with:
languages: ${{ matrix.language }}
build-mode: none
- name: Restore core solution
if: matrix.language == 'csharp'
run: dotnet restore ModularPipelines.sln
- name: Analyze
uses: github/codeql-action/analyze@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4
with:
category: /language:${{ matrix.language }}
output: ${{ runner.temp }}/codeql-results
upload: failure-only
- name: Upload results
id: upload
continue-on-error: true
uses: github/codeql-action/upload-sarif@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4
with:
category: /language:${{ matrix.language }}
sarif_file: ${{ runner.temp }}/codeql-results
- name: Retry results upload
if: steps.upload.outcome == 'failure'
uses: github/codeql-action/upload-sarif@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4
with:
category: /language:${{ matrix.language }}
sarif_file: ${{ runner.temp }}/codeql-results