Skip to content

Commit

Permalink
Merge pull request #35 from joaopapereira/trivy-task-uses-version-in-…
Browse files Browse the repository at this point in the history
…go-mod

When no go version is provided it will read it from the go.mod file
  • Loading branch information
joaopapereira authored Jun 20, 2024
2 parents 2991cd0 + 8c82aa3 commit 7aa0cf8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
required: false
type: string
description: Version of Go used to compile the application
default: 1.17.0
default: ""
secrets:
slackWebhookURL:
required: true
Expand All @@ -36,17 +36,24 @@ jobs:
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
repository: ${{ inputs.repo }}
ref: ${{ inputs.branch }}

# Backwards compatibility, when no version is provided it will use the go.mod file version
- name: Set up Go
uses: actions/setup-go@v2
if: inputs.goVersion != ''
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.goVersion }}
- name: Set up Go
if: inputs.goVersion == ''
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Build the ${{ inputs.tool }} binary file
run: |
Expand Down

0 comments on commit 7aa0cf8

Please sign in to comment.