File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5151 nightvision scan ${NIGHTVISION_TARGET} --auth ${NIGHTVISION_AUTH} > scan-results.txt
5252 nightvision export sarif -s "$(head -n 1 scan-results.txt)" --swagger-file openapi-spec.yml
5353
54+ - name : (5.5) Remap info-level findings to warning for GitHub visibility
55+ run : |
56+ python3 << 'EOF'
57+ import json
58+
59+ # Read the SARIF file
60+ with open('results.sarif', 'r') as f :
61+ sarif = json.load(f)
62+
63+ # Remap "note" level to "warning" so GitHub displays them
64+ for run in sarif.get('runs', []) :
65+ for result in run.get('results', []) :
66+ if result.get('level') == 'note' :
67+ result['level'] = 'warning'
68+ print(f"Remapped : {result.get('message', {}).get('text', 'Unknown')}")
69+
70+ # Write back the modified SARIF
71+ with open('results.sarif', 'w') as f :
72+ json.dump(sarif, f, indent=2)
73+
74+ print("\n✅ Successfully remapped info-level findings to warning")
75+ EOF
76+
5477 - name : (6) Upload SARIF file to GitHub Security Alerts if Vulnerabilities are found
5578 uses : github/codeql-action/upload-sarif@v3
5679 if : success()
You can’t perform that action at this time.
0 commit comments