Skip to content

Commit

Permalink
Let the gofmt action fail if the source isn't properly formatted in t…
Browse files Browse the repository at this point in the history
…he GitHub action
  • Loading branch information
MarkKremer authored and mewmew committed Oct 27, 2023
1 parent 38455e9 commit bc22414
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ jobs:
run: go test -v -covermode atomic -coverprofile=covprofile ./...

- name: Gofmt
run: gofmt -d ./
# Run gofmt, print the output and exit with status code 1 if it isn't empty.
run: |
OUTPUT=$(gofmt -d ./)
echo "$OUTPUT"
test -z "$OUTPUT"
- name: Send coverage
if: ${{ matrix.go-version == 'stable' && github.ref == 'refs/heads/master' }}
Expand Down

0 comments on commit bc22414

Please sign in to comment.