diff --git a/.github/workflows/build_template.yml b/.github/workflows/build_template.yml index a984589caaa..44f5dc5bb7d 100644 --- a/.github/workflows/build_template.yml +++ b/.github/workflows/build_template.yml @@ -9,6 +9,24 @@ on: type: string jobs: + tidy: + runs-on: ubuntu-latest + steps: + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ inputs.go-version }} + + - name: Checkout code + uses: actions/checkout@v4 + + - name: go mod tidy + working-directory: ${{ inputs.modulepath }} + run: go mod tidy -v + + - name: Check git diff + run: git diff --exit-code || (echo 'go mod tidy has made changes'; exit 1) + generated: runs-on: ubuntu-latest steps: @@ -16,10 +34,10 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ inputs.go-version }} - + - name: Checkout code uses: actions/checkout@v4 - + - name: Check generated files are up to date working-directory: ${{ inputs.modulepath }} run: |