-
Notifications
You must be signed in to change notification settings - Fork 2.1k
87 lines (76 loc) · 2.39 KB
/
Copy pathcodeql.yml
File metadata and controls
87 lines (76 loc) · 2.39 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
name: CodeQL
on:
push:
branches:
- main
pull_request:
branches:
- main
merge_group:
types:
- checks_requested
schedule:
- cron: '0 6 * * 1' # Run weekly on Monday at 6:00 UTC
jobs:
# Keep the final job id as "analyze" so CodeQL matches its analysis_key to the configuration on main.
generate:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 360
permissions:
security-events: write
packages: read
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: csharp
build-mode: none
- language: javascript-typescript
build-mode: none
- language: actions
build-mode: none
steps:
- name: Checkout repository
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Initialize CodeQL
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4
with:
category: "/language:${{ matrix.language }}"
upload: never
post-processed-sarif-path: sarif-results
- name: Stage CodeQL results
if: github.event_name != 'merge_group'
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: codeql-sarif-${{ matrix.language }}
path: sarif-results
retention-days: 1
analyze:
name: Upload CodeQL results
if: github.event_name != 'merge_group'
needs: generate
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Download CodeQL results
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: codeql-sarif-*
path: sarif-results
- name: Upload CodeQL results
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4
with:
sarif_file: sarif-results