diff --git a/.github/workflows/cover.yaml b/.github/workflows/cover.yaml index 43774cba3e9..7278db8f27b 100644 --- a/.github/workflows/cover.yaml +++ b/.github/workflows/cover.yaml @@ -17,11 +17,14 @@ jobs: uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 with: egress-policy: audit - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 + - name: Get Go version + id: vars + run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT + - name: Set up Go + uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 with: - go-version: '1.24' + go-version: ${{ steps.vars.outputs.go_version }} - run: "PATH=/usr/local/go/bin:$PATH make test-cover" - uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 env: diff --git a/.github/workflows/dependabot-code-gen.yml b/.github/workflows/dependabot-code-gen.yml index e2f4d115cdf..aa700004818 100644 --- a/.github/workflows/dependabot-code-gen.yml +++ b/.github/workflows/dependabot-code-gen.yml @@ -23,10 +23,13 @@ jobs: uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 with: egress-policy: audit - - name: Set up Go 1.x + - name: Get Go version + id: vars + run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT + - name: Set up Go uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 with: - go-version: '1.24' + go-version: ${{ steps.vars.outputs.go_version }} id: go - name: Check out code into the Go module directory uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 diff --git a/.github/workflows/pr-golangci-lint.yaml b/.github/workflows/pr-golangci-lint.yaml index 86f1c326540..3271be7b53d 100644 --- a/.github/workflows/pr-golangci-lint.yaml +++ b/.github/workflows/pr-golangci-lint.yaml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag=v5.0.0 - - name: Calculate go version + - name: Get Go version id: vars run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a934261c99c..7b7f3133edc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -104,7 +104,7 @@ jobs: with: fetch-depth: 0 ref: ${{ env.RELEASE_TAG }} - - name: Calculate go version + - name: Get Go version run: echo "go_version=$(make go-version)" >> $GITHUB_ENV - name: Set up Go uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # tag=v6.0.0 diff --git a/.github/workflows/weekly-security-scan.yaml b/.github/workflows/weekly-security-scan.yaml index 32d7b198ebb..f029aa9f3b5 100644 --- a/.github/workflows/weekly-security-scan.yaml +++ b/.github/workflows/weekly-security-scan.yaml @@ -21,7 +21,7 @@ jobs: uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag=v5.0.0 with: ref: ${{ matrix.branch }} - - name: Calculate go version + - name: Get Go version id: vars run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT - name: Set up Go diff --git a/Makefile b/Makefile index 9a7b7092fd2..cbcf68d4268 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ SHELL:=/usr/bin/env bash .DEFAULT_GOAL:=help -GO_VERSION ?= $(shell sed -n 's/^go //p' go.mod) +GO_VERSION ?= $(shell sed -n 's/^toolchain go//p' go.mod) GOPATH := $(shell go env GOPATH) GOARCH := $(shell go env GOARCH) GOOS := $(shell go env GOOS)