Update build-and-test.yml

This commit is contained in:
NealDeal34 authored and GitHub committed 2026-01-28 04:27:17 +08:00
1 parent e0b34e8b9a
commit 41a6cc0711
1 file changed
+21 -11
+21 -11
View File
@@ -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 '[email protected]'
git add -A
git commit -m 'Apply spotless formatting' || exit 0
git push