Skip to content

Commit 6840064

Browse files
authored
Update nightvision.yml
1 parent 9533e62 commit 6840064

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

.github/workflows/nightvision.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,29 @@ jobs:
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()

0 commit comments

Comments
 (0)