Repository navigation
ci: run bandit from the locked sast group instead of bandit-action - #528
Merged
Merged
Conversation
PyCQA/bandit-action v1 hardcodes Python 3.8 (v1.0.1: 3.9), which the ubuntu-latest runner no longer provides, so the sast job failed during setup on every run before bandit started. Run the bandit pinned in uv.lock with the pyproject.toml configuration, the same way tox -e sast does. Findings now fail the job; the action ignored bandit's exit code and only uploaded SARIF results.
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.
The
sastjob fails on every run, both on master and on PRs, before Bandit even starts:PyCQA/bandit-action@v1(=v1.0.0) hardcodespython-version: 3.8, andv1.0.1hardcodes3.9. Neither is available on the currentubuntu-latest. A configurablepython-versionexists only on the action's unreleasedmain(PyCQA/bandit-action#27, #31).Change
Drop the action and run the Bandit pinned in
uv.lock(sastgroup, 1.9.4) with thepyproject.tomlconfiguration. This is the same setup as thepycqaworkflow andtox -e sast:Behavior differences:
|| trueand only uploaded SARIF.contents: read.Locally, Bandit 1.9.4 reports no issues on
src/validators.