diff --git a/.github/workflows/auto-formatter.yml b/.github/workflows/auto-formatter.yml deleted file mode 100644 index c411b58..0000000 --- a/.github/workflows/auto-formatter.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: gofumpt - -on: - push: - branches: [main] - -jobs: - prettier: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - ref: ${{ github.head_ref }} - fetch-depth: 0 - - - name: Auto Format code - uses: iamnotaturtle/auto-gofmt@v2.0.0 - with: - only_changed: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3fce11e..984ab2d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,6 +33,13 @@ jobs: uses: actions/setup-go@v3 with: go-version: "${{ matrix.go }}" + - name: Check Go code formatting + run: | + if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then + gofmt -s -l . + echo "Please format Go code by running: go fmt ./..." + exit 1 + fi - name: Build run: | go vet ./...