From 4d3f9b2ecc34de40aafa1338939e5355bd421ce3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 18:57:46 +0000 Subject: [PATCH 1/5] :arrow_up: Bump golang from 1.20 to 1.21 Bumps golang from 1.20 to 1.21. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 937f013..8fc817a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ ARG GOLANG_VERSION=1.20 # This golang version is for the builder only -FROM golang:1.20 as builder +FROM golang:1.21 as builder WORKDIR /go/src/github.com/Templum/govulncheck-action/ ENV GO111MODULE=on From a4633f73e5aef9cb2eaeb916d5099cd9df508950 Mon Sep 17 00:00:00 2001 From: Templum Date: Mon, 20 Nov 2023 20:41:02 +0000 Subject: [PATCH 2/5] :wrench: Updated default Golang Version to 1.21 --- Dockerfile | 2 +- README.md | 2 +- action.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8fc817a..62b7dae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG GOLANG_VERSION=1.20 +ARG GOLANG_VERSION=1.21 # This golang version is for the builder only FROM golang:1.21 as builder diff --git a/README.md b/README.md index e155995..29be6df 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,7 @@ jobs: | Input | Description | |----------------------------------|----------------------------------------------------------------------------------------------------------------| -| `go-version` _(optional)_ | Version of Go used for scanning the code, should equal *your* runtime version. Defaults to `1.20.6` | +| `go-version` _(optional)_ | Version of Go used for scanning the code, should equal *your* runtime version. Defaults to `1.21.4` | | `vulncheck-version` _(optional)_ | Version of govulncheck that should be used, by default `v1.0.0` | | `package` _(optional)_ | The package you want to scan, by default will be `./...` | | `github-token` _(optional)_ | Github Token to upload sarif report. **Needs** `write` permissions for `security_events` | diff --git a/action.yml b/action.yml index cf96efe..7b506ef 100644 --- a/action.yml +++ b/action.yml @@ -7,9 +7,9 @@ inputs: required: false default: "./..." go-version: - description: "Can be any Tag for the golang docker image, but should ideally match your runtime go version. By default 1.20.6 is assumed" + description: "Can be any Tag for the golang docker image, but should ideally match your runtime go version. By default 1.21.4 is assumed" required: false - default: "1.20.6" + default: "1.21.4" vulncheck-version: description: "Version of govulncheck that should be used, by default v1.0.0" required: false From 387540a52aeddb3117d7e02d333792df498ecc59 Mon Sep 17 00:00:00 2001 From: Templum Date: Mon, 20 Nov 2023 20:41:33 +0000 Subject: [PATCH 3/5] :pushpin: Pinned 1.21 for Actions Pipeline --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63fbf90..69c5481 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: 1.20.0 + go-version: '1.21' - name: Compile Action run: go build -v ./... unit-testing: @@ -34,7 +34,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: 1.20.0 + go-version: '1.21' - name: Run Unit Test with Racecondition Detector run: go test -race ./... - name: Run Unit Tests with Coverage From 0163c4fb3dc04655c9a694d9f91054df03d0fca5 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 21 Nov 2023 13:54:02 +0000 Subject: [PATCH 4/5] :wrench: Updated DevContainer --- .devcontainer/Dockerfile | 4 ++-- .devcontainer/devcontainer.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a8dcfd4..7e44e73 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,8 +1,8 @@ # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.231.6/containers/go/.devcontainer/base.Dockerfile # [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): 1, 1.16, 1.17, 1-bullseye, 1.16-bullseye, 1.17-bullseye, 1-buster, 1.16-buster, 1.17-buster -ARG VARIANT="1.20-bullseye" -FROM mcr.microsoft.com/vscode/devcontainers/go:0-${VARIANT} +ARG VARIANT="1.21-bullseye" +FROM mcr.microsoft.com/vscode/devcontainers/go:${VARIANT} # [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 ARG NODE_VERSION="none" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 39bb174..9347650 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -8,7 +8,7 @@ // Update the VARIANT arg to pick a version of Go: 1, 1.18, 1.17 // Append -bullseye or -buster to pin to an OS version. // Use -bullseye variants on local arm64/Apple Silicon. - "VARIANT": "1.20-bullseye", + "VARIANT": "1.21-bullseye", // Options "NODE_VERSION": "none", "VULNCHECK_VERSION": "v1.0.0" From 3480e16e554fce8f445d3a79a219d53bb8f325d8 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 21 Nov 2023 13:54:27 +0000 Subject: [PATCH 5/5] :bug: Fixed Implementation for 1.21 --- pkg/action/env.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/action/env.go b/pkg/action/env.go index d22fb9d..f5e1e6d 100644 --- a/pkg/action/env.go +++ b/pkg/action/env.go @@ -24,17 +24,17 @@ func ReadRuntimeInfoFromEnv() *RuntimeInfos { if strings.Contains(env, "GOARCH") { keyVal := strings.SplitAfter(env, "=") - info.Arch = strings.Trim(keyVal[1], "\"") + info.Arch = strings.Trim(strings.Trim(keyVal[1], "\""), "'") } if strings.Contains(env, "GOVERSION") { keyVal := strings.SplitAfter(env, "=") - info.Version = strings.Trim(keyVal[1], "\"") + info.Version = strings.Trim(strings.Trim(keyVal[1], "\""), "'") } if strings.Contains(env, "GOOS") { keyVal := strings.SplitAfter(env, "=") - info.Os = strings.Trim(keyVal[1], "\"") + info.Os = strings.Trim(strings.Trim(keyVal[1], "\""), "'") } }