11name : " Test different uses of `upload-sarif`"
22description : " Checks that uploading SARIFs to the code quality endpoint works"
33versions : ["default"]
4+ analysisKinds : ["code-scanning", "code-quality", "code-scanning,code-quality"]
45installGo : true
56steps :
67 - uses : ./../action/init
78 with :
89 tools : ${{ steps.prepare-test.outputs.tools-url }}
910 languages : csharp,java,javascript,python
10- analysis-kinds : code-quality
11+ analysis-kinds : ${{ matrix.analysis-kinds }}
1112 - name : Build code
1213 run : ./build.sh
1314 # Generate some SARIF we can upload with the upload-sarif step
@@ -16,11 +17,17 @@ steps:
1617 ref : ' refs/heads/main'
1718 sha : ' 5e235361806c361d4d3f8859e3c897658025a9a2'
1819 upload : never
19- - uses : ./../action/upload-sarif
20+
21+ - name : |
22+ Upload all SARIF files for `analysis-kinds: ${{ matrix.analysis-kinds }}`
23+ uses: ./../action/upload-sarif
2024 id: upload-sarif
2125 with:
2226 ref: 'refs/heads/main'
2327 sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
24- - name : " Check output from `upload-sarif` step"
25- if : ' !(fromJSON(steps.upload-sarif.outputs.sarif-ids).code-quality)'
28+ - name : " Check output from `upload-sarif` step for `code-scanning`"
29+ if : " contains(matrix.analysis-kinds, 'code-scanning') && !(fromJSON(steps.upload-sarif.outputs.sarif-ids).code-scanning)"
30+ run : exit 1
31+ - name : " Check output from `upload-sarif` step for `code-quality`"
32+ if : " contains(matrix.analysis-kinds, 'code-quality') && !(fromJSON(steps.upload-sarif.outputs.sarif-ids).code-quality)"
2633 run : exit 1
0 commit comments