Bump pytest from 8.2.2 to 8.3.1 #147
Workflow file for this run
This file contains 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
# https://github.com/marketplace/actions/bandit-scan is ISC licensed, by abirismyname | |
# https://pypi.org/project/bandit/ is Apache v2.0 licensed, by PyCQA | |
name: Bandit | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
bandit: | |
permissions: | |
contents: read # for actions/checkout to fetch code | |
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | |
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | |
runs-on: ubuntu-latest | |
steps: | |
- name: Sleep for 5min to let Jenkins checks start | |
uses: jakejarvis/wait-action@master | |
with: | |
time: '5m' | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
pip install bandit bandit-sarif-formatter | |
- name: Run Bandit scan | |
shell: bash | |
run: | | |
UPPERCASE_LEVEL=$(echo $INPUT_LEVEL | tr a-z A-Z) | |
case $UPPERCASE_LEVEL in | |
LOW) | |
LEVEL="-l" | |
;; | |
MEDIUM | MID) | |
LEVEL="-ll" | |
;; | |
HIGH) | |
LEVEL="-lll" | |
;; | |
*) | |
LEVEL="" | |
;; | |
esac | |
UPPERCASE_CONFIDENCE=$(echo $INPUT_CONFIDENCE | tr a-z A-Z) | |
case $UPPERCASE_CONFIDENCE in | |
LOW) | |
CONFIDENCE="-i" | |
;; | |
MEDIUM | MID) | |
CONFIDENCE="-ii" | |
;; | |
HIGH) | |
CONFIDENCE="-iii" | |
;; | |
*) | |
CONFIDENCE="" | |
;; | |
esac | |
if [ "$INPUT_EXCLUDED_PATHS" == "DEFAULT" ]; then | |
EXCLUDED_PATHS="" | |
else | |
EXCLUDED_PATHS="-x $INPUT_EXCLUDED_PATHS" | |
fi | |
if [ "$INPUT_EXIT_ZERO" == "DEFAULT" ]; then | |
EXIT_ZERO="" | |
else | |
EXIT_ZERO="--exit-zero" | |
fi | |
if [ "$INPUT_SKIPS" == "DEFAULT" ]; then | |
SKIPS="" | |
else | |
SKIPS="-s $INPUT_SKIPS" | |
fi | |
if [ "$INPUT_INI_PATH" == "DEFAULT" ]; then | |
INI_PATH="" | |
else | |
INI_PATH="--ini $INPUT_INI_PATH" | |
fi | |
bandit -f sarif -o results.sarif -r $INPUT_PATH $LEVEL $CONFIDENCE $EXCLUDED_PATHS $EXIT_ZERO $SKIPS $INI_PATH | |
env: | |
INPUT_PATH: '.' | |
INPUT_LEVEL: 'UNDEFINED' | |
INPUT_CONFIDENCE: 'UNDEFINED' | |
INPUT_EXCLUDED_PATHS: 'DEFAULT' | |
INPUT_EXIT_ZERO: true | |
INPUT_SKIPS: 'DEFAULT' | |
INPUT_INI_PATH: 'DEFAULT' | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: results.sarif | |
path: results.sarif | |
- name: Upload SARIF file | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: results.sarif | |