File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Check if go.mod is tidy
2+ on :
3+ pull_request :
4+
5+ concurrency :
6+ group : " ${{ github.workflow }}/${{ github.ref }}"
7+ cancel-in-progress : true
8+
9+ jobs :
10+ check-tidy-go-mod :
11+ name : ensure that go mod tidy has run
12+ runs-on : ubuntu-latest
13+ container :
14+ image : ghcr.io/cloudfoundry/app-autoscaler-release-tools:main
15+ steps :
16+ - uses : actions/checkout@v4
17+
18+ - name : Trust my checkout
19+ run : git config --global --add safe.directory "${GITHUB_WORKSPACE}"
20+
21+ - name : run go mod tidy on all .mod's
22+ shell : bash
23+ run : |
24+ #! /usr/bin/env bash
25+ set -eu -o pipefail
26+
27+ make generate-fakes
28+ make generate-openapi-generated-clients-and-servers
29+ make go-mod-tidy
30+
31+ - name : Check if there is any change
32+ id : get_changes
33+ run : echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
34+
35+ - name : Process changes
36+ if : steps.get_changes.outputs.changed != 0
37+ run : |
38+ echo "::error::go.mod is not tidy, run make go-mod-tidy to tidy"
39+ exit 1
You can’t perform that action at this time.
0 commit comments