From 4fad0ef4884e736d1fd60033cb915b1ac601a0f8 Mon Sep 17 00:00:00 2001 From: Templum Date: Sat, 18 Feb 2023 12:27:32 +0000 Subject: [PATCH 1/4] :technologist: Upgraded devcontainer to 1.20 --- .devcontainer/Dockerfile | 2 +- .devcontainer/devcontainer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 454c326..5439c4b 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,7 +1,7 @@ # 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.19-bullseye" +ARG VARIANT="1.20-bullseye" FROM mcr.microsoft.com/vscode/devcontainers/go:0-${VARIANT} # [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8e5707a..30cbc86 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.19-bullseye", + "VARIANT": "1.20-bullseye", // Options "NODE_VERSION": "none" } From 0c8a3e02d34671ac80f71cd05c4a8e0caedf8b30 Mon Sep 17 00:00:00 2001 From: Templum Date: Sat, 18 Feb 2023 12:28:57 +0000 Subject: [PATCH 2/4] :wrench: Updated Github Flows to 1.20 --- .github/workflows/ci.yml | 4 ++-- .github/workflows/integration.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1388bf..9cb297e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.19 + go-version: 1.20.0 - name: Compile Action run: go build -v ./... unit-testing: @@ -34,7 +34,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.19 + go-version: 1.20.0 - name: Run Unit Test with Racecondition Detector run: go test -race ./... - name: Run Unit Tests with Coverage diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 5be3009..c7accfb 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -19,7 +19,7 @@ jobs: uses: Templum/govulncheck-action@main with: skip-upload: true - go-version: 1.19 + go-version: 1.20.0 env: GH_PAT_TOKEN: ${{ secrets.PAT_TOKEN }} GOPRIVATE: "github.com/Templum/private-lib" From 46bf97825ee5d1402567ef008a3fff6e8bfe4427 Mon Sep 17 00:00:00 2001 From: Templum Date: Sat, 18 Feb 2023 12:29:31 +0000 Subject: [PATCH 3/4] :arrow_up: :bulb: Golang to 1.20 Also added some clarifying comments --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2beb57e..d47a441 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ ARG GOLANG_VERSION=1.19 -FROM golang:1.19 as builder +# This golang version is for the builder only +FROM golang:1.20 as builder WORKDIR /go/src/github.com/Templum/govulncheck-action/ ENV GO111MODULE=on @@ -9,16 +10,15 @@ RUN go mod download COPY . . -# Statically compile our app for use in a distroless container RUN CGO_ENABLED=0 go build -ldflags="-w -s" -v -o action . - +# This golang version determines in which golang environment the customer code is checked FROM golang:$GOLANG_VERSION ARG VULNCHECK_VERSION=latest RUN go install golang.org/x/vuln/cmd/govulncheck@$VULNCHECK_VERSION +# This allows private repositories hosted on Github ARG GH_PAT_TOKEN RUN if [[ -n "$GH_PAT_TOKEN" ]]; then echo "No token was provided"; else git config --global --add url."https://govulncheck_action:$GH_PAT_TOKEN@github.com/".insteadOf "https://github.com/"; fi - ARG GOPRIVATE ENV GOPRIVATE=$GOPRIVATE From f6788a0bf013730edf58c91dd9959615c6e26f33 Mon Sep 17 00:00:00 2001 From: Templum Date: Sat, 18 Feb 2023 12:29:51 +0000 Subject: [PATCH 4/4] :alien: Updated Config to honour new spec --- .devcontainer/devcontainer.json | 70 +++++++++++++++++---------------- 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 30cbc86..493d83d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -18,42 +18,46 @@ "--security-opt", "seccomp=unconfined" ], - // Set *default* container specific settings.json values on container create. - "settings": { - "go.gocodeAutoBuild": false, - "files.autoSave": "afterDelay", - "editor.formatOnPaste": true, - "editor.formatOnSave": true, - "go.gopath": "/go", - "go.goroot": "/usr/local/go", - "go.toolsGopath": "/go/bin", - "go.buildOnSave": "workspace", - "go.lintOnSave": "package", - "go.vetOnSave": "package", - "go.coverOnSave": false, - "go.useCodeSnippetsOnFunctionSuggest": false, - "go.lintTool": "golangci-lint", - "go.formatTool": "goimports", - "[go]": { - "editor.codeActionsOnSave": { - "source.organizeImports": true - } - }, - "[go.mod]": { - "editor.minimap.enabled": false - }, - "[go.sum]": { - "editor.minimap.enabled": false + "customizations": { + "vscode": { + "settings": { + "go.gocodeAutoBuild": false, + "files.autoSave": "afterDelay", + "editor.formatOnPaste": true, + "editor.formatOnSave": true, + "go.gopath": "/go", + "go.goroot": "/usr/local/go", + "go.toolsGopath": "/go/bin", + "go.buildOnSave": "workspace", + "go.lintOnSave": "package", + "go.vetOnSave": "package", + "go.coverOnSave": false, + "go.useCodeSnippetsOnFunctionSuggest": false, + "go.lintTool": "golangci-lint", + "go.formatTool": "goimports", + "[go]": { + "editor.codeActionsOnSave": { + "source.organizeImports": true + } + }, + "[go.mod]": { + "editor.minimap.enabled": false + }, + "[go.sum]": { + "editor.minimap.enabled": false + } + }, + "extensions": [ + "golang.Go", + "streetsidesoftware.code-spell-checker", + "premparihar.gotestexplorer", + "wayou.vscode-todo-highlight", + "bierner.github-markdown-preview" + ] } }, + // Set *default* container specific settings.json values on container create. // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "golang.Go", - "streetsidesoftware.code-spell-checker", - "premparihar.gotestexplorer", - "wayou.vscode-todo-highlight", - "bierner.github-markdown-preview" - ], // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], // Use 'postCreateCommand' to run commands after the container is created.