mirror of
https://github.com/nlohmann/json.git
synced 2026-04-10 18:18:52 +00:00
Fix SARIF file handling in GitHub workflow
Patch SARIF file for GitHub upload and update upload step. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
18
.github/workflows/msvc.yml
vendored
18
.github/workflows/msvc.yml
vendored
@@ -52,15 +52,15 @@ jobs:
|
|||||||
# Ruleset file that will determine what checks will be run
|
# Ruleset file that will determine what checks will be run
|
||||||
ruleset: NativeRecommendedRules.ruleset
|
ruleset: NativeRecommendedRules.ruleset
|
||||||
|
|
||||||
# Upload SARIF file to GitHub Code Scanning Alerts
|
- name: Patch SARIF for GitHub upload
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
$sarif = Get-Content "${{ steps.run-analysis.outputs.sarif }}" -Raw | ConvertFrom-Json
|
||||||
|
$i = 0
|
||||||
|
foreach ($run in $sarif.runs) { $run.properties.category = "run-$i"; $i++ }
|
||||||
|
$sarif | ConvertTo-Json -Depth 100 | Out-File -Encoding utf8 "${{ env.build }}/results_fixed.sarif"
|
||||||
|
|
||||||
- name: Upload SARIF to GitHub
|
- name: Upload SARIF to GitHub
|
||||||
uses: github/codeql-action/upload-sarif@v3
|
uses: github/codeql-action/upload-sarif@v3
|
||||||
with:
|
with:
|
||||||
sarif_file: ${{ steps.run-analysis.outputs.sarif }}
|
sarif_file: ${{ env.build }}/results_fixed.sarif
|
||||||
|
|
||||||
# Upload SARIF file as an Artifact to download and view
|
|
||||||
# - name: Upload SARIF as an Artifact
|
|
||||||
# uses: actions/upload-artifact@v4
|
|
||||||
# with:
|
|
||||||
# name: sarif-file
|
|
||||||
# path: ${{ steps.run-analysis.outputs.sarif }}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user