https://github.com/katexochen/go-tidy-check
GitHub action to check if your Go modules are tidy
https://github.com/katexochen/go-tidy-check
ci github-actions go golang
Last synced: 12 months ago
JSON representation
GitHub action to check if your Go modules are tidy
- Host: GitHub
- URL: https://github.com/katexochen/go-tidy-check
- Owner: katexochen
- License: mit
- Created: 2022-09-13T14:33:26.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-24T17:27:57.000Z (over 1 year ago)
- Last Synced: 2024-10-25T07:28:32.926Z (over 1 year ago)
- Topics: ci, github-actions, go, golang
- Homepage:
- Size: 39.1 KB
- Stars: 13
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/katexochen/go-tidy-check/actions/workflows/test-integration.yml)
[](https://github.com/katexochen/go-tidy-check/actions/workflows/test-lint.yml)
# ๐งน Check if your modules are tidy
This tool checks whether `go mod tidy` would change your modules `go.mod` or `go.sum` file.
The action can check multiple (sub)modules and will print a diff of the changes that should
be made. It will not make any changes to your modules.
May there be a [`go mod tidy -check`](https://github.com/golang/go/issues/27005) in the future to replace this action.
## ๐ฅ Action
### Usage
```yaml
name: Go mod tidy check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4 # Go version must be at least 1.20.
- uses: katexochen/go-tidy-check@v2
with:
# (Optional) The path to the root of each modules, space separated. Default is the current directory.
modules: . ./module1 ./module2
# (Optional) Check submodules. This will use a go.work file if present, otherwise search subdirectories
# for go.mod files. Default is false.
submodules: "true"
```