Skip to content

Commit

Permalink
⬆️ Bump golang from 1.20 to 1.21 (#53)
Browse files Browse the repository at this point in the history
* ⬆️ 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] <[email protected]>

* 🔧 Updated default Golang  Version to 1.21

* 📌 Pinned 1.21 for Actions Pipeline

* 🔧 Updated DevContainer

* 🐛 Fixed Implementation for 1.21

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Templum <[email protected]>
  • Loading branch information
dependabot[bot] and Templum authored Nov 21, 2023
1 parent ec892db commit cd4addc
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions pkg/action/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -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], "\""), "'")
}

}
Expand Down

0 comments on commit cd4addc

Please sign in to comment.