Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
feat(gosec): add option to pass extra flags
Browse files Browse the repository at this point in the history
  • Loading branch information
erzz committed Jan 13, 2022
1 parent d830460 commit 5b15ea3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ on:
type: string
description: "Set a custom path to scan if required (default = ./...)"
default: "./..."
gosec-extra-flags:
required: false
type: string
description: "Pass any extra gosec flags here such as -exclude=G104"
default: ""
# <---------------- UNIT TEST OPTIONS ---------------->
gcp-sa-auth:
required: false
Expand Down Expand Up @@ -149,7 +154,7 @@ jobs:
- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: "-fmt html -out gosec-report.html -stdout -verbose=text -conf .gosec-config.json ${{ inputs.gosec-scan-path }}"
args: "-fmt html -out gosec-report.html -stdout -verbose=text -conf .gosec-config.json ${{ inputs.gosec-extra-flags }} ${{ inputs.gosec-scan-path }}"

- name: Upload Report
uses: actions/upload-artifact@v2
Expand Down
1 change: 1 addition & 0 deletions docs/go-tests/go-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ go-tests:
| `cc-blocker-threshold` | false | `0` | Max number of BLOCKER Code Climate findings allowed before forcing a failed result |
| `gosec-default-config` | false | `true` | Set to false if you want to use your own `.gosec-config.json` |
| `gosec-scan-path` | false | `./...` | Set a custom path for gosec to scan if required |
| `gosec-extra-flags` | false | `""` | Pass any extra gosec flags here such as `-exclude=G104` |
| `unit-test-path` | false | `./...` | Set a custom path for the go test command if required |

## Outputs
Expand Down

0 comments on commit 5b15ea3

Please sign in to comment.