Skip to content

Commit 3ab8218

Browse files
authored
Allow config file specification
1 parent 7264faa commit 3ab8218

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

action.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ inputs:
3232
description: 'path to a .bandit file that supplies command line arguments'
3333
required: false
3434
default: 'DEFAULT'
35+
config_path:
36+
description: 'path to a YAML or TOML file that supplies command line arguments'
37+
required: false
38+
default: 'DEFAULT'
3539
GITHUB_TOKEN:
3640
description: 'Github token of the repository (automatically created by Github)'
3741
required: true
@@ -102,15 +106,22 @@ runs:
102106
else
103107
INI_PATH="--ini $INPUT_INI_PATH"
104108
fi
105-
bandit -f sarif -o results.sarif -r $INPUT_PATH $LEVEL $CONFIDENCE $EXCLUDED_PATHS $EXIT_ZERO $SKIPS $INI_PATH
109+
110+
if [ "$INPUT_CONFIG_PATH" == "DEFAULT" ]; then
111+
CONFIG_PATH=""
112+
else
113+
CONFIG_PATH="-c $INPUT_CONFIG_PATH"
114+
fi
115+
bandit -f sarif -o results.sarif -r $INPUT_PATH $LEVEL $CONFIDENCE $EXCLUDED_PATHS $EXIT_ZERO $SKIPS $INI_PATH $CONFIG_PATH
106116
env:
107117
INPUT_PATH: ${{ inputs.path }}
108118
INPUT_LEVEL: ${{ inputs.level }}
109119
INPUT_CONFIDENCE: ${{ inputs.confidence }}
110120
INPUT_EXCLUDED_PATHS: ${{ inputs.excluded_paths }}
111121
INPUT_EXIT_ZERO: ${{ inputs.exit_zero }}
112122
INPUT_SKIPS: ${{ inputs.skips }}
113-
INPUT_INI_PATH: ${{ inputs.ini_path }}
123+
INPUT_INI_PATH: ${{ inputs.ini_path }}
124+
INPUT_CONFIG_PATH: ${{ inputs.config_path }}
114125

115126
- name: Upload artifact
116127
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)