Commit 2658b9f
ci(sonar): treat exit-1 (issues found) as scan success, not job failure
The CLI's three-state exit codes are part of its contract: 0=clean,
1=issues found (normal), 2+=tool error. GitHub Actions' default
'bash -e' shell propagated exit 1 from a healthy scan as a step
failure — masking the 'job ran but found things' signal we actually
want, and breaking the workflow on the very first run that found any
issue.
Fix: capture rc with set+e/set-e, fail the step only on rc>=2 (real
tool error). The Quality gate step (still informational) keeps the
'should we block on the findings themselves?' decision, decoupled from
'did the scanner run?'.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 6d202ba commit 2658b9f
1 file changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
76 | 85 | | |
77 | 86 | | |
| 87 | + | |
78 | 88 | | |
79 | 89 | | |
80 | 90 | | |
81 | 91 | | |
82 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
83 | 100 | | |
84 | 101 | | |
85 | 102 | | |
| |||
0 commit comments