There was an error while loading. Please reload this page.
1 parent 9271325 commit 96eee0eCopy full SHA for 96eee0e
1 file changed
.github/workflows/security.yml
@@ -45,13 +45,13 @@ jobs:
45
--redact \
46
--report-format json \
47
--report-path gitleaks-report.json || EXIT_CODE=$?
48
- if [ -f gitleaks-report.json ] && [ -s gitleaks-report.json ]; then
49
- echo "::error::Secrets detected by gitleaks. See report for details."
50
- cat gitleaks-report.json
51
- exit 1
52
- fi
53
- if [ "${EXIT_CODE:-0}" -ne 0 ]; then
54
+ if [ -f gitleaks-report.json ]; then
+ CONTENT=$(cat gitleaks-report.json | tr -d '[:space:]')
+ if [ "$CONTENT" != "[]" ] && [ "$CONTENT" != "null" ] && [ -n "$CONTENT" ]; then
+ echo "::error::Secrets detected by gitleaks. See report for details."
+ cat gitleaks-report.json
+ exit 1
+ fi
55
fi
56
echo "✅ No secrets detected"
57
0 commit comments