From a49ce41d9644ee955f28ab479491774084e49e09 Mon Sep 17 00:00:00 2001 From: RawDiamondMC Date: Sat, 16 Nov 2024 00:09:15 +0800 Subject: [PATCH] feat: Add spotless action --- .github/workflows/spotless.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/spotless.yml diff --git a/.github/workflows/spotless.yml b/.github/workflows/spotless.yml new file mode 100644 index 00000000..bdf616ef --- /dev/null +++ b/.github/workflows/spotless.yml @@ -0,0 +1,30 @@ +name: Run spotless +on: [push, workflow_dispatch] + +jobs: + build: + strategy: + matrix: + java: + - 21 + runs-on: ubuntu-24.04 + steps: + - name: checkout repository + uses: actions/checkout@v4 + - name: setup jdk ${{ matrix.java }} + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: "microsoft" + - name: setup gradle + uses: gradle/actions/setup-gradle@v4 + - name: make gradle wrapper executable + run: chmod +x ./gradlew + - name: apply spotless + run: ./gradlew spotlessApply + - name: Commit and push to site branch + run: | + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + git commit -m "chore: Apply Spotless" + git push