Skip to content

Pull useful improvements from Community #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ inputs:
description: 'path to a .bandit file that supplies command line arguments'
required: false
default: 'DEFAULT'
config_path:
description: 'path to a YAML or TOML file that supplies command line arguments'
required: false
default: 'DEFAULT'
GITHUB_TOKEN:
description: 'Github token of the repository (automatically created by Github)'
required: true
Expand Down Expand Up @@ -102,24 +106,32 @@ runs:
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

if [ "$INPUT_CONFIG_PATH" == "DEFAULT" ]; then
CONFIG_PATH=""
else
CONFIG_PATH="-c $INPUT_CONFIG_PATH"
fi
bandit -f sarif -o results.sarif -r $INPUT_PATH $LEVEL $CONFIDENCE $EXCLUDED_PATHS $EXIT_ZERO $SKIPS $INI_PATH $CONFIG_PATH
env:
INPUT_PATH: ${{ inputs.path }}
INPUT_LEVEL: ${{ inputs.level }}
INPUT_CONFIDENCE: ${{ inputs.confidence }}
INPUT_EXCLUDED_PATHS: ${{ inputs.excluded_paths }}
INPUT_EXIT_ZERO: ${{ inputs.exit_zero }}
INPUT_SKIPS: ${{ inputs.skips }}
INPUT_INI_PATH: ${{ inputs.ini_path }}
INPUT_INI_PATH: ${{ inputs.ini_path }}
INPUT_CONFIG_PATH: ${{ inputs.config_path }}

- name: Upload artifact
uses: actions/upload-artifact@main
uses: actions/upload-artifact@v4
with:
name: results.sarif
path: results.sarif
overwrite: true

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif

Expand Down