diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/lint.yml similarity index 53% rename from .github/workflows/golangci-lint.yml rename to .github/workflows/lint.yml index e4a22d52e4..7c3963ef63 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: golangci-lint +name: Lint on: workflow_call: permissions: @@ -19,3 +19,20 @@ jobs: uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3 with: version: v1.55.2 + + mod-tidy: + name: Go mod tidy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5 + with: + go-version-file: 'go.mod' + cache: false + - name: go mod tidy + run: go mod tidy + - name: git diff + run: git diff --exit-code + - name: Output message + if: ${{ failure() }} + run: echo "Please run 'go mod tidy' and commit changes" \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 023623ea36..63c49db2b3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,8 +28,8 @@ permissions: jobs: license-check: uses: ./.github/workflows/license-check.yml - golangci-lint: - uses: ./.github/workflows/golangci-lint.yml + lint: + uses: ./.github/workflows/lint.yml build: uses: ./.github/workflows/build.yml test: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 00b72071fb..0d8da1a960 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -24,8 +24,8 @@ permissions: jobs: license-check: uses: ./.github/workflows/license-check.yml - golangci-lint: - uses: ./.github/workflows/golangci-lint.yml + lint: + uses: ./.github/workflows/lint.yml build: uses: ./.github/workflows/build.yml test: diff --git a/.github/workflows/tags.yml b/.github/workflows/tags.yml index 0334a0ef94..ed9a2fec3d 100644 --- a/.github/workflows/tags.yml +++ b/.github/workflows/tags.yml @@ -27,8 +27,8 @@ permissions: jobs: license-check: uses: ./.github/workflows/license-check.yml - golangci-lint: - uses: ./.github/workflows/golangci-lint.yml + lint: + uses: ./.github/workflows/lint.yml build: uses: ./.github/workflows/build.yml test: