format: spotless auto-apply [bot] #99
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Spotless Auto-Commit | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| spotless-apply: | |
| if: "!contains(github.event.head_commit.message, '[bot]')" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up SSH for Deploy Key | |
| run: | | |
| mkdir -p ~/.ssh | |
| echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_ed25519 | |
| chmod 600 ~/.ssh/id_ed25519 | |
| ssh-keyscan github.com >> ~/.ssh/known_hosts | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: main | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '22' | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Run spotlessApply | |
| run: ./gradlew spotlessApply | |
| - name: Commit & Push changes (if needed) | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git add . | |
| git diff --cached --exit-code || (git commit -m "format: spotless auto-apply [bot]" && git push git@github.com:SymmetricDevs/Susy-Core.git main) |