Skip to content

Commit 83103e4

Browse files
committed
fix(deps): use Go version from Dockerfile
1 parent 3f11901 commit 83103e4

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@ jobs:
1515
with:
1616
token: ${{ secrets.API_GITHUB_TOKEN }}
1717

18+
- name: Fetch Go version
19+
run: |
20+
GO_VERSION=$(perl -ne 'print "$1\n" if /FROM golang:([0-9.]+)/' Dockerfile | head -n1)
21+
[ -n "$GO_VERSION" ] || exit 1
22+
echo "go_version=$GO_VERSION" >> $GITHUB_ENV
23+
1824
- name: Setup Go environment
1925
uses: actions/[email protected]
2026
with:
21-
go-version: "1.16"
27+
go-version: "${{ env.go_version }}"
2228

2329
- name: Binaries Release
2430
uses: goreleaser/[email protected]

.github/workflows/test.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,16 @@ jobs:
2121
if: github.event_name == 'pull_request'
2222
uses: actions/[email protected]
2323

24+
- name: Fetch Go version
25+
run: |
26+
GO_VERSION=$(perl -ne 'print "$1\n" if /FROM golang:([0-9.]+)/' Dockerfile | head -n1)
27+
[ -n "$GO_VERSION" ] || exit 1
28+
echo "go_version=$GO_VERSION" >> $GITHUB_ENV
29+
2430
- name: Setup Go environment
2531
uses: actions/[email protected]
2632
with:
27-
go-version: "1.16"
33+
go-version: "${{ env.go_version }}"
2834

2935
- name: Program Test
3036
run: go test ./...

0 commit comments

Comments
 (0)