Skip to content

Commit 1dd97e7

Browse files
committed
ci: Use own action to setup go version
1 parent d1c938e commit 1dd97e7

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.github/workflows/go.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ jobs:
55
name: Build
66
runs-on: ubuntu-latest
77
steps:
8-
- name: Set up Go 1.20
8+
- uses: actions/checkout@v3
9+
- name: Get go mod info
10+
id: gomod
11+
uses: pawndev/go-modfile-information@v1.0.0
12+
- name: Set up Go
913
uses: actions/setup-go@v3
1014
with:
11-
go-version: '^1.20'
12-
id: go
13-
- uses: actions/checkout@v3
15+
go-version: '^${{ steps.gomod.outputs.go_version }}'
1416
- name: Build
1517
run: |
1618
go mod download

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ See the [examples](#examples) for how to use it
2525

2626
## Examples
2727

28+
Or see [this workflow](https://github.com/pawndev/go-modfile-information/blob/main/.github/workflows/go.yml)
29+
2830
```yaml
2931
...
3032
- name: Get go mod info
3133
id: gomod
32-
uses: pawndev/go-modfile-information@v1
34+
uses: pawndev/go-modfile-information@v1.0.0
3335
with:
3436
modfile: go.mod # optional default to `go.mod`
3537
- name: Print go mod information

0 commit comments

Comments
 (0)