diff --git a/.github/workflows/go-formatting.yml b/.github/workflows/go-formatting.yml index 6c1c044..d1cf30f 100644 --- a/.github/workflows/go-formatting.yml +++ b/.github/workflows/go-formatting.yml @@ -16,21 +16,20 @@ jobs: uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: '1.22.5' - name: Run GoFmt id: gofmt-run run: | - if ! gofmt -d backend/aashub/ > gofmt_output.txt; then - echo "Formatting issues found" + gofmt -d backend/aashub/ > gofmt_output.txt + if [ -s gofmt_output.txt ]; then + echo "Formatting issues found:" cat gofmt_output.txt exit 1 fi - name: GoFmt Output - if: ${{ failure() }} - run: | - echo "The following files are not formatted:" - cat gofmt_output.txt \ No newline at end of file + if: failure() + run: echo "Check formatting issues in the logs."