diff --git a/.github/workflows/check-fmt.yml b/.github/workflows/check-fmt.yml new file mode 100644 index 0000000..3fe15d6 --- /dev/null +++ b/.github/workflows/check-fmt.yml @@ -0,0 +1,33 @@ +name: Check make fmt +on: + push: + branches: + - master + pull_request: + +permissions: + contents: read + +jobs: + check-make-fmt: + name: Check make fmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: install go1.21 + uses: actions/setup-go@v5 + with: + go-version: "1.21" + + - name: Run make fmt + run: make fmt + + - name: Check if make fmt generated changes that should be committed + run: | + if [ -n "$(git status --porcelain)" ]; then + echo "Error: make fmt generated changes that should be committed. Please run 'make fmt' and commit the changes." + git diff + git status + exit 1 + fi \ No newline at end of file diff --git a/.github/workflows/go.yml b/.github/workflows/tests.yml similarity index 99% rename from .github/workflows/go.yml rename to .github/workflows/tests.yml index 022eca8..ca0dff1 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,6 @@ on: branches: [ "main" ] jobs: - build: runs-on: ubuntu-latest steps: