ci: make gofmt check fail for a non-empty diff (#7131)

Fixes #7130.

Change-Id: If47eb472ea98a8d8b250c5c681c7862d252645fb
Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
This commit is contained in:
M. J. Fromberger 2023-01-31 11:16:39 -08:00 committed by GitHub
parent 100d8e909e
commit 3eae75b1b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,9 @@ jobs:
with:
go-version-file: go.mod
- name: Run gofmt (goimports)
run: go run golang.org/x/tools/cmd/goimports -d --format-only .
run: |
OUT=$(go run golang.org/x/tools/cmd/goimports -d --format-only .)
[ -z "$OUT" ] || (echo "Not gofmt'ed: $OUT" && exit 1)
- uses: k0kubun/action-slack@v2.0.0
with:
payload: |