Preserve Bandit execution errors before SARIF upload - #39
Open
noqt wants to merge 2 commits into
Open
Conversation
added 2 commits
August 27, 2026 16:46
Allow Bandit exit 0 and 1 to continue to SARIF upload, but stop on execution errors so the original failure stays visible.
Restore the upstream LF line endings so the pull request contains only the intended Bandit exit-code handling change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #16.
Bandit returns exit code 1 when it finds issues and has still written valid SARIF, so that result should be uploaded. Exit code 2 means Bandit could not run—for example, because of a bad config—and the current catch-all lets upload-sarif hide the useful error behind a second “Invalid SARIF” failure.
This captures the exit code, lets 0 and 1 continue, and stops on higher codes before the upload step.
We hit this path while testing Bandit SARIF as an input to NOQT's Lumi Trace. I verified the 0/1/2 behavior with a deterministic shell check; YAML parsing and the Git whitespace check also pass.