From 41a6cc071113c6a82d47ebcf51b1ea479383a8cf Mon Sep 17 00:00:00 2001 From: NealDeal34 <130116696+NealDeal34@users.noreply.github.com> Date: Wed, 28 Jan 2026 04:27:17 +0800 Subject: [PATCH] Update build-and-test.yml --- .github/workflows/build-and-test.yml | 32 ++++++++++++++++++---------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 3ee2f686..bff9a446 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,13 +1,23 @@ - -name: Build and test - -on: - pull_request: - branches: [ master, main ] - push: - branches: [ master, main ] +name: Fix Spotless Formatting +on: + workflow_dispatch: # 允许手动触发 jobs: - build-and-test: - uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master - secrets: inherit + spotless-fix: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: '8' + - name: Run spotlessApply + run: ./gradlew spotlessApply + - name: Commit changes + run: | + git config --global user.name 'GitHub Action' + git config --global user.email 'action@github.com' + git add -A + git commit -m 'Apply spotless formatting' || exit 0 + git push