Skip to content

Commit 88abfc4

Browse files
committed
Use simpler go-version-file option
1 parent 777623b commit 88abfc4

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

.github/workflows/go.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Go
1818
uses: actions/setup-go@v5
1919
with:
20-
go-version: 1.20
20+
go-version-file: "go.mod"
2121
- name: Run flaky tests sequentially
2222
run:
2323
| # Upstream flakes are race conditions exacerbated by concurrent tests
@@ -35,7 +35,7 @@ jobs:
3535
- name: Set up Go
3636
uses: actions/setup-go@v5
3737
with:
38-
go-version: 1.20
38+
go-version-file: "go.mod"
3939

4040
- name: Run `go generate`
4141
run: go list ./... | grep -Pv "${EXCLUDE_REGEX}" | xargs go generate;

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- uses: actions/checkout@v4
2222
- uses: actions/setup-go@v5
2323
with:
24-
go-version: 1.20
24+
go-version-file: "go.mod"
2525
- name: goheader
2626
# The goheader linter is only enabled in the CI so that it runs only on modified or new files
2727
# (see only-new-issues: true). It is disabled in .golangci.yml because

.github/workflows/rename-module.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Set up Go
4747
uses: actions/setup-go@v5
4848
with:
49-
go-version: 1.20
49+
go-version-file: "go.mod"
5050

5151
- name: Smoke tests
5252
# `go list` shows us the module name and grep will non-zero exit on mismatch
@@ -75,18 +75,3 @@ jobs:
7575
commit_message: "[AUTO] rename Go module + update internal import paths\n\nWorkflow: ${{ steps.vars.outputs.WORKFLOW_HASH }} on branch ${{ github.ref_name }}"
7676
repo: ${{ github.repository }}
7777
branch: ${{ steps.vars.outputs.DEST_BRANCH }}
78-
79-
- name: Update .github yml files "go-version" properties
80-
shell: bash
81-
run: |
82-
gomodver=$(sed -n 's/^go \([0-9.]*\)/\1/p' go.mod)
83-
sed -i '' -E "s/go-version: 1\.[0-9]\+/go-version: \$gomodver/g" .github/workflows/*.yml
84-
85-
- name: Signed commit to branch
86-
uses: planetscale/ghcommit-action@d4176bfacef926cc2db351eab20398dfc2f593b5 # v0.2.0
87-
env:
88-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
89-
with:
90-
commit_message: "[AUTO] update .github workflows go-version properties"
91-
repo: ${{ github.repository }}
92-
branch: ${{ needs.rename-module.outputs.vars.DEST_BRANCH }}

0 commit comments

Comments
 (0)