From 8c82aa3242d638079ab041490929301e2667896b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= Date: Mon, 17 Jun 2024 15:06:33 -0500 Subject: [PATCH] When no go version is provided it will read it from the go.mod file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated thje version of the actions Signed-off-by: João Pereira --- .github/workflows/trivy-scan.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml index 5f325f6..5014ed3 100644 --- a/.github/workflows/trivy-scan.yml +++ b/.github/workflows/trivy-scan.yml @@ -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 @@ -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: |