diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..0bf0b52 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,27 @@ +name: Format + +on: + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + - name: Build project with gradle + uses: gradle/actions/setup-gradle@v4 + - name: Format with Spotless + run: gradle spotlessApply + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Apply formatting changes