Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow patch version in go.mod #1

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,14 @@ jobs:
modfile: go.mod
- name: Check outputs
run: |
test "${{ steps.selftest.outputs.go_version }}" == "1.20"
test "${{ steps.selftest.outputs.go_version }}" == "1.22.0"
test "${{ steps.selftest.outputs.go_module }}" == "github.com/pawndev/go-modfile-information"
- name: Self test two digits format
id: selftest_two_digits
uses: ./
with:
modfile: tests/two-digits.go.mod
- name: Check outputs
run: |
test "${{ steps.selftest_two_digits.outputs.go_version }}" == "1.21"
test "${{ steps.selftest_two_digits.outputs.go_module }}" == "github.com/pawndev/go-modfile-information"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20 as builder
FROM golang:1.22 as builder

WORKDIR /app
COPY . /app
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ See the [examples](#examples) for how to use it

### Inputs

| Input | Description | Default value |
|-----------------------------|---------------------------------|---------------|
| `modfile` | An example mandatory input | go.mod |
| Input | Description | Default value |
| --------- | -------------------------- | ------------- |
| `modfile` | An example mandatory input | go.mod |

### Outputs

| Output | Description |
|--------------|--------------------------|
| ------------ | ------------------------ |
| `go_version` | Go version of the module |
| `go_module` | Go module name |

Expand Down Expand Up @@ -50,4 +50,6 @@ with:
## Testing locally

Be sure to have [act](https://github.com/nektos/act) locally and available il your `$PATH`.
And then you can `make test` to launch the project locally.
And then you can `make test` to launch the project locally.

Folder `tests` contains another go.mod file with old version format using only major and minor without the patch number `1.21`.
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/pawndev/go-modfile-information

go 1.20
go 1.22.0

toolchain go1.23.0

require (
github.com/sethvargo/go-githubactions v1.1.0
golang.org/x/mod v0.9.0
github.com/sethvargo/go-githubactions v1.3.0
golang.org/x/mod v0.21.0
)

require github.com/sethvargo/go-envconfig v0.8.0 // indirect
11 changes: 4 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
github.com/sethvargo/go-envconfig v0.8.0 h1:AcmdAewSFAc7pQ1Ghz+vhZkilUtxX559QlDuLLiSkdI=
github.com/sethvargo/go-envconfig v0.8.0/go.mod h1:Iz1Gy1Sf3T64TQlJSvee81qDhf7YIlt8GMUX6yyNFs0=
github.com/sethvargo/go-githubactions v1.1.0 h1:mg03w+b+/s5SMS298/2G6tHv8P0w0VhUFaqL1THIqzY=
github.com/sethvargo/go-githubactions v1.1.0/go.mod h1:qIboSF7yq2Qnaw2WXDsqCReM0Lo1gU4QXUWmhBC3pxE=
golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs=
golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
github.com/sethvargo/go-githubactions v1.3.0 h1:Kg633LIUV2IrJsqy2MfveiED/Ouo+H2P0itWS0eLh8A=
github.com/sethvargo/go-githubactions v1.3.0/go.mod h1:7/4WeHgYfSz9U5vwuToCK9KPnELVHAhGtRwLREOQV80=
golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0=
golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
8 changes: 8 additions & 0 deletions tests/two-digits.go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module github.com/pawndev/go-modfile-information

go 1.21

require (
github.com/sethvargo/go-githubactions v1.3.0
golang.org/x/mod v0.21.0
)
Loading