29
29
jobs :
30
30
analyze :
31
31
name : Analyze (${{ matrix.language }})
32
- runs-on : ${{ (matrix.language == 'swift' && 'macos-latest') || ' ubuntu-latest' }}
32
+ runs-on : ubuntu-latest
33
33
permissions :
34
34
security-events : write
35
35
packages : read
@@ -42,59 +42,37 @@ jobs:
42
42
include :
43
43
- language : go
44
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
45
+ query : codeql/go-queries:AlertSuppression.ql
51
46
52
47
steps :
53
48
- name : Checkout repository
54
49
uses : actions/checkout@v4
55
50
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
65
-
66
51
- name : Initialize CodeQL
67
52
uses : github/codeql-action/init@v3
68
53
with :
69
54
languages : ${{ matrix.language }}
70
55
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
56
+ packs : ${{ matrix.query }}
82
57
83
58
- name : Perform CodeQL Analysis
59
+ # define an 'id' for the analysis step
84
60
id : analyze
85
61
uses : github/codeql-action/analyze@v2
86
62
with :
87
63
category : " /language:${{matrix.language}}"
64
+ # define the output folder for SARIF files
88
65
output : sarif-results
89
66
90
67
- name : Dismiss alerts
91
68
if : github.ref == 'refs/heads/main'
92
- uses : advanced-security/dismiss-alerts@main
69
+ uses : advanced-security/dismiss-alerts@v2
93
70
with :
71
+ # specify a 'sarif-id' and 'sarif-file'
94
72
sarif-id : ${{ steps.analyze.outputs.sarif-id }}
95
- sarif-file : sarif-results/${{ env .language }}.sarif
73
+ sarif-file : sarif-results/${{ matrix .language }}.sarif
96
74
env :
97
- GITHUB_TOKEN : ${{ github.token }
75
+ GITHUB_TOKEN : ${{ github.token }}
98
76
` ` `
99
77
100
78
### Third party produced SARIF file
0 commit comments