bot-75: auth #147
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: | |
| push: | |
| branches: [dev] | |
| pull_request: | |
| branches: [dev, main] | |
| jobs: | |
| go-mod-tidy: | |
| name: tidy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Go 1.24 | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ^1.24.5 | |
| - name: Check for 'go mod tidy' changes | |
| run: | | |
| # Запускаем команду, которая может изменить файлы. | |
| go mod tidy | |
| # Проверяем, есть ли изменения в рабочей директории. | |
| if [[ -n $(git status --porcelain go.mod go.sum) ]]; then | |
| echo "::error::go.mod/go.sum are not tidy." | |
| echo "Please run 'go mod tidy' locally and commit the changes." | |
| echo "" | |
| echo "-------------------- git diff output --------------------" | |
| git diff | |
| echo "---------------------------------------------------------" | |
| exit 1 | |
| else | |
| echo "go.mod and go.sum are tidy." | |
| fi |