Skip to content

Commit 054c536

Browse files
Harden empty SAST output handling.
Keep report generation stable by writing empty JSON payloads when Bandit or Semgrep do not emit an output file. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent f543298 commit 054c536

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

.github/workflows/security_audit.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ jobs:
3434
bandit -r TVWeb/app TVSecure TVConnections \
3535
-f json \
3636
-o security_audit/out/bandit.json || true
37+
if [ ! -s security_audit/out/bandit.json ]; then
38+
printf '{\n "results": []\n}\n' > security_audit/out/bandit.json
39+
fi
3740
3841
- name: Run Semgrep
3942
run: |
@@ -43,6 +46,9 @@ jobs:
4346
--json \
4447
--output security_audit/out/semgrep.json \
4548
TVWeb/app TVSecure TVConnections || true
49+
if [ ! -s security_audit/out/semgrep.json ]; then
50+
printf '{\n "results": []\n}\n' > security_audit/out/semgrep.json
51+
fi
4652
4753
- name: Render readable reports
4854
run: |

0 commit comments

Comments
 (0)