@@ -17,60 +17,84 @@ CodeQL populates the `suppression` property in its SARIF output based on the res
17
17
### Example - CodeQL
18
18
19
19
``` yaml
20
- name : " CodeQL"
20
+ name : " CodeQL Advanced "
21
21
22
22
on :
23
23
push :
24
- branches : [ main ]
24
+ branches : [main]
25
25
pull_request :
26
- branches : [ main ]
27
-
26
+ branches : [main]
27
+ schedule :
28
+ - cron : " 31 7 * * 3"
28
29
jobs :
29
30
analyze :
30
- name : Analyze
31
- runs-on : ubuntu-latest
31
+ name : Analyze (${{ matrix.language }})
32
+ runs-on : ${{ (matrix.language == 'swift' && 'macos-latest') || ' ubuntu-latest' }}
32
33
permissions :
34
+ security-events : write
35
+ packages : read
33
36
actions : read
34
37
contents : read
35
- security-events : write
36
38
37
39
strategy :
38
40
fail-fast : false
39
41
matrix :
40
- language : [ "java" ]
42
+ include :
43
+ - language : go
44
+ build-mode : autobuild
45
+ - language : java-kotlin
46
+ build-mode : none
47
+ - language : javascript-typescript
48
+ build-mode : none
49
+ - language : python
50
+ build-mode : none
41
51
42
52
steps :
43
53
- name : Checkout repository
44
- uses : actions/checkout@v3
54
+ uses : actions/checkout@v4
55
+
56
+ - name : Map Languages
57
+ run : |
58
+ if [ "${{ matrix.language }}" == "java-kotlin" ]; then
59
+ echo "language=java" >> $GITHUB_ENV
60
+ elif [ "${{ matrix.language }}" == "javascript-typescript" ]; then
61
+ echo "language=javascript" >> $GITHUB_ENV
62
+ else
63
+ echo "language=${{ matrix.language }}" >> $GITHUB_ENV
64
+ fi
45
65
46
66
- name : Initialize CodeQL
47
- uses : github/codeql-action/init@v2
67
+ uses : github/codeql-action/init@v3
48
68
with :
49
69
languages : ${{ matrix.language }}
50
- # run an 'alert-suppression' query
51
- packs : " codeql/${{ matrix.language }}-queries:AlertSuppression.ql"
52
-
53
- - name : Autobuild
54
- uses : github/codeql-action/autobuild@v2
70
+ build-mode : ${{ matrix.build-mode }}
71
+ packs : " codeql/${{ env.language }}-queries:AlertSuppression.ql"
72
+
73
+ - if : matrix.build-mode == 'manual'
74
+ shell : bash
75
+ run : |
76
+ echo 'If you are using a "manual" build mode for one or more of the' \
77
+ 'languages you are analyzing, replace this with the commands to build' \
78
+ 'your code, for example:'
79
+ echo ' make bootstrap'
80
+ echo ' make release'
81
+ exit 1
55
82
56
83
- name : Perform CodeQL Analysis
57
- # define an 'id' for the analysis step
58
84
id : analyze
59
85
uses : github/codeql-action/analyze@v2
60
86
with :
61
87
category : " /language:${{matrix.language}}"
62
- # define the output folder for SARIF files
63
88
output : sarif-results
64
-
89
+
65
90
- name : Dismiss alerts
66
91
if : github.ref == 'refs/heads/main'
67
- uses : advanced-security /dismiss-alerts@v1
92
+ uses : s-samadi /dismiss-alerts@main
68
93
with :
69
- # specify a 'sarif-id' and 'sarif-file'
70
94
sarif-id : ${{ steps.analyze.outputs.sarif-id }}
71
- sarif-file : sarif-results/${{ matrix .language }}.sarif
95
+ sarif-file : sarif-results/${{ env .language }}.sarif
72
96
env :
73
- GITHUB_TOKEN : ${{ github.token }}
97
+ GITHUB_TOKEN : ${{ github.token }
74
98
` ` `
75
99
76
100
### Third party produced SARIF file
0 commit comments