Skip to content

Commit

Permalink
When no go version is provided it will read it from the go.mod file
Browse files Browse the repository at this point in the history
Updated thje version of the actions

Signed-off-by: João Pereira <[email protected]>
  • Loading branch information
joaopapereira committed Jun 17, 2024
1 parent 2991cd0 commit 8c82aa3
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 8c82aa3

Please sign in to comment.