chore: stop vendoring #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Go mod tidy check | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| - '**/feature/**' | |
| permissions: | |
| contents: read | |
| jobs: | |
| tidy-check: | |
| name: Ensure `go mod tidy` is clean | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| # Use the latest stable Go to run tidy. The repo's Makefile also runs plain `go mod tidy`. | |
| # Using `stable` avoids pinning to a possibly non-existent Go version in go.mod. | |
| go-version: stable | |
| cache: true | |
| - name: Show Go version | |
| run: go version | |
| - name: Run go mod tidy (via Makefile if available) | |
| run: | | |
| if make -n tidy >/dev/null 2>&1; then | |
| make tidy | |
| else | |
| go mod tidy | |
| fi | |
| - name: Fail if go.mod or go.sum changed | |
| run: | | |
| git status --porcelain | |
| # Only check for changes in go.mod / go.sum | |
| if ! git diff --exit-code -- go.mod go.sum; then | |
| echo "go mod tidy produced changes. Please run 'go mod tidy' locally and commit the results." >&2 | |
| exit 1 | |
| fi |