Add option to ignore rule IDs (#18)
* add exclude-rules to action arguments * add --ignore-rule-ids as an arg to entrypoint * document changes * fix if statement, use a variable to store command and arg * readme: document changes
This commit is contained in:
Родитель
3c4e8976e8
Коммит
334a444807
|
@ -26,6 +26,7 @@ You can also specify a number of options to the action.
|
|||
output-filename: devskim-results.sarif
|
||||
output-directory: path/to/output (appended to $GITHUB_WORKSPACE)
|
||||
ignore-globs: "**/.git/**,*.txt"
|
||||
exclude-rules: DS176209, DS148264
|
||||
```
|
||||
|
||||
## Features
|
||||
|
|
|
@ -21,6 +21,10 @@ inputs:
|
|||
description: 'Optional comma separated list of file globs to ignore when scanning.'
|
||||
required: false
|
||||
default: "**/.git/**,**/bin/**"
|
||||
exclude-rules:
|
||||
description: 'Optional comma separated list of rule IDs to ignore'
|
||||
required: false
|
||||
default: ""
|
||||
branding:
|
||||
icon: 'check-square'
|
||||
color: 'green'
|
||||
|
@ -32,4 +36,5 @@ runs:
|
|||
- ${{ inputs.should-scan-archives }}
|
||||
- ${{ inputs.output-filename }}
|
||||
- ${{ inputs.output-directory }}
|
||||
- ${{ inputs.ignore-globs }}
|
||||
- ${{ inputs.ignore-globs }}
|
||||
- ${{ inputs.exclude-rules }}
|
|
@ -5,6 +5,7 @@
|
|||
# $3 is the output filename
|
||||
# $4 is the output directory
|
||||
# $5 is the file globs to ignore
|
||||
# $6 is the ruleids to exclude
|
||||
|
||||
if [ "$1" = "GITHUB_WORKSPACE" ]; then
|
||||
ScanTarget=$GITHUB_WORKSPACE
|
||||
|
@ -22,4 +23,10 @@ if [ "$2" = "true" ]; then
|
|||
Opts = "-c"
|
||||
fi
|
||||
|
||||
/tools/devskim analyze --source-code "$ScanTarget" --output-file "$OutputDirectory/$3" $Opts --ignore-globs $5 --base-path $GITHUB_WORKSPACE
|
||||
if [ -z "$6" ]; then
|
||||
Idopts=""
|
||||
else
|
||||
Idopts="--ignore-rule-ids $6"
|
||||
fi
|
||||
|
||||
/tools/devskim analyze --source-code "$ScanTarget" --output-file "$OutputDirectory/$3" $Opts --ignore-globs $5 $Idopts
|
||||
|
|
Загрузка…
Ссылка в новой задаче