fix(deps): update go patch dependencies #122
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 lint | |
| "on": | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| go-lint: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up Go | |
| uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 | |
| with: | |
| go-version-file: go.mod | |
| - name: Check formatting | |
| run: | | |
| #!/bin/bash | |
| set -o errexit -o nounset -o pipefail | |
| unformatted=$(gofmt -l .) | |
| if [ -n "$unformatted" ]; then | |
| echo "::error::The following files are not formatted:" | |
| echo "$unformatted" | |
| echo "Please run 'gofmt -w .' and commit the changes." | |
| exit 1 | |
| fi | |
| - name: Check if dependencies are tidy | |
| run: | | |
| #!/bin/bash | |
| set -o errexit -o nounset -o pipefail | |
| go mod tidy | |
| if ! git diff --quiet; then | |
| git diff --color | |
| echo "::error::go mod tidy made changes" | |
| echo "Please run 'go mod tidy' and commit the changes." | |
| exit 1 | |
| fi |