Skip to content

Commit 7380ed5

Browse files
authored
.github/workflows: Use new setup-go go-version-file input (#197)
Reference: https://github.com/actions/setup-go/releases/tag/v3.1.0
1 parent 21e3000 commit 7380ed5

File tree

6 files changed

+7
-33
lines changed

6 files changed

+7
-33
lines changed

.github/workflows/ci-github-actions.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v3
17-
- id: go-version
18-
# Reference: https://github.com/actions/setup-go/issues/23
19-
run: echo "::set-output name=version::$(cat ./.go-version)"
2017
- uses: actions/setup-go@v3
2118
with:
22-
go-version: ${{ steps.go-version.outputs.version }}
19+
go-version-file: 'go.mod'
2320
- run: go install github.com/rhysd/actionlint/cmd/actionlint@latest
2421
- run: actionlint

.github/workflows/ci-go.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
paths:
77
- .github/workflows/ci-go.yml
88
- .golangci.yml
9-
- .go-version
109
- go.mod
1110
- '**.go'
1211

@@ -18,12 +17,9 @@ jobs:
1817
runs-on: ubuntu-latest
1918
steps:
2019
- uses: actions/checkout@v3
21-
- id: go-version
22-
# Reference: https://github.com/actions/setup-go/issues/23
23-
run: echo "::set-output name=version::$(cat ./.go-version)"
2420
- uses: actions/setup-go@v3
2521
with:
26-
go-version: ${{ steps.go-version.outputs.version }}
22+
go-version-file: 'go.mod'
2723
- run: go mod download
2824
- uses: golangci/[email protected]
2925
terraform-provider-corner-tfprotov5:
@@ -38,13 +34,9 @@ jobs:
3834
with:
3935
path: terraform-provider-corner
4036
repository: hashicorp/terraform-provider-corner
41-
- id: go-version
42-
# Reference: https://github.com/actions/setup-go/issues/23
43-
run: echo "::set-output name=version::$(cat ./.go-version)"
44-
working-directory: .
4537
- uses: actions/setup-go@v3
4638
with:
47-
go-version: ${{ steps.go-version.outputs.version }}
39+
go-version-file: 'go.mod'
4840
- uses: hashicorp/setup-terraform@v2
4941
with:
5042
terraform_version: ${{ matrix.terraform }}
@@ -80,13 +72,9 @@ jobs:
8072
with:
8173
path: terraform-provider-corner
8274
repository: hashicorp/terraform-provider-corner
83-
- id: go-version
84-
# Reference: https://github.com/actions/setup-go/issues/23
85-
run: echo "::set-output name=version::$(cat ./.go-version)"
86-
working-directory: .
8775
- uses: actions/setup-go@v3
8876
with:
89-
go-version: ${{ steps.go-version.outputs.version }}
77+
go-version-file: 'go.mod'
9078
- uses: hashicorp/setup-terraform@v2
9179
with:
9280
terraform_version: ${{ matrix.terraform }}

.github/workflows/ci-goreleaser.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v3
17-
- id: go-version
18-
# Reference: https://github.com/actions/setup-go/issues/23
19-
run: echo "::set-output name=version::$(cat ./.go-version)"
2017
- uses: actions/setup-go@v3
2118
with:
22-
go-version: ${{ steps.go-version.outputs.version }}
19+
go-version-file: 'go.mod'
2320
- uses: goreleaser/goreleaser-action@v3
2421
with:
2522
args: check

.github/workflows/ci-protobuf.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
pull_request:
66
paths:
77
- .github/workflows/ci-protobuf.yml
8-
- .go-version
98
- go.mod
109
- go.sum
1110
- 'tfprotov5/internal/tfplugin5/*'
@@ -19,12 +18,9 @@ jobs:
1918
runs-on: ubuntu-latest
2019
steps:
2120
- uses: actions/checkout@v3
22-
- id: go-version
23-
# Reference: https://github.com/actions/setup-go/issues/23
24-
run: echo "::set-output name=version::$(cat ./.go-version)"
2521
- uses: actions/setup-go@v3
2622
with:
27-
go-version: ${{ steps.go-version.outputs.version }}
23+
go-version-file: 'go.mod'
2824
- uses: arduino/setup-protoc@v1
2925
with:
3026
# The version string is embedded in protoc generated files, so it is

.github/workflows/release.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@ jobs:
1919
with:
2020
# Required for release notes
2121
fetch-depth: 0
22-
- id: go-version
23-
# Reference: https://github.com/actions/setup-go/issues/23
24-
run: echo "::set-output name=version::$(cat ./.go-version)"
2522
- uses: actions/setup-go@v3
2623
with:
27-
go-version: ${{ steps.go-version.outputs.version }}
24+
go-version-file: 'go.mod'
2825
- name: Generate Release Notes
2926
# Fetch CHANGELOG.md contents up to Git tag prior to this release, skipping top two lines
3027
run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git describe --abbrev=0 --exclude="$(git describe --abbrev=0 --match='v*.*.*' --tags)" --match='v*.*.*' --tags | tr -d v)/q;p" CHANGELOG.md > /tmp/release-notes.txt

.go-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)