Skip to content

Commit e426b46

Browse files
committed
Use env variable to specify Go version in CI
1 parent 78a9928 commit e426b46

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

.github/workflows/documentation.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- 'v[0-9]+.[0-9]+.[0-9]+'
77

88
env:
9+
GO_VERSION: '1.21.1'
910
PB_BUILD_VERSION: unknown # Needed for using Make targets.
1011
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
1112

@@ -21,7 +22,7 @@ jobs:
2122
- name: Export GOBIN
2223
uses: actions/setup-go@v4
2324
with:
24-
go-version: '1.21.1'
25+
go-version: '${{env.GO_VERSION}}'
2526

2627
- name: Install dependencies
2728
run: make setup

.github/workflows/publish.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
tags:
66
- 'v[0-9]+.[0-9]+.[0-9]+'
77

8+
env:
9+
GO_VERSION: '1.21.1'
10+
811
jobs:
912
test:
1013
name: Test
@@ -19,7 +22,7 @@ jobs:
1922
- name: Export GOBIN
2023
uses: actions/setup-go@v4
2124
with:
22-
go-version: '1.21.1'
25+
go-version: '${{env.GO_VERSION}}'
2326

2427
- name: Install dependencies
2528
run: make setup
@@ -86,7 +89,7 @@ jobs:
8689
- name: Export GOBIN
8790
uses: actions/setup-go@v4
8891
with:
89-
go-version: '1.20.5'
92+
go-version: '${{env.GO_VERSION}}'
9093

9194
- name: Run GoReleaser
9295
uses: goreleaser/goreleaser-action@v4

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ name: Test
33
on:
44
push:
55
branches:
6-
- '**'
7-
tags:
8-
- '**'
9-
- '!v[0-9]+.[0-9]+.[0-9]+'
6+
- 'main'
107
pull_request:
8+
branches:
9+
- 'main'
1110

1211
env:
12+
GO_VERSION: '1.21.1'
1313
PB_BUILD_VERSION: pipeline-${{ github.sha }}
1414

1515
jobs:
@@ -24,7 +24,7 @@ jobs:
2424
- name: Export GOBIN
2525
uses: actions/setup-go@v4
2626
with:
27-
go-version: '1.21.1'
27+
go-version: '${{env.GO_VERSION}}'
2828

2929
- name: Install dependencies
3030
run: make setup

0 commit comments

Comments
 (0)