From d22a7b6ede51ff233f0b7030f53308c8222fa46b Mon Sep 17 00:00:00 2001 From: Cosmin Cojocar Date: Wed, 8 Feb 2023 10:40:36 +0100 Subject: [PATCH] Add gosec version as an input parameter to GitHub action (#927) * Add gosec version as a paramter to the Github action * Run gosec as a github action as part of CI --- .github/workflows/ci.yml | 7 ++++++- README.md | 1 + action.yml | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8add85e..4802de1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,12 @@ jobs: - name: lint uses: golangci/golangci-lint-action@v3 with: - version: ${{ matrix.version.golangci }} + version: ${{ matrix.version.golangci }} + - name: Run Gosec Security Scanner + uses: securego/gosec@master + with: + version: '2.15.0' + args: ./... - name: Run Tests run: make test coverage: diff --git a/README.md b/README.md index bf7aa08..f2a6766 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ jobs: - name: Run Gosec Security Scanner uses: securego/gosec@master with: + version: 'latest' args: ./... ``` diff --git a/action.yml b/action.yml index aab6c80..38fc9b9 100644 --- a/action.yml +++ b/action.yml @@ -3,6 +3,10 @@ description: 'Runs the gosec security checker' author: '@ccojocar' inputs: + version: + description: 'Version of gosec to use (e.g. 2.15.0)' + required: false + default: 'latest' args: description: 'Arguments for gosec' required: true @@ -10,7 +14,7 @@ inputs: runs: using: 'docker' - image: 'docker://securego/gosec' + image: 'docker://securego/gosec:${{inputs.version}}' args: - ${{ inputs.args }}