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" 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 diff --git a/Dockerfile b/Dockerfile index 937f013..62b7dae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -ARG GOLANG_VERSION=1.20 +ARG GOLANG_VERSION=1.21 # 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 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 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], "\""), "'") } }