-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (33 loc) · 1.04 KB
/
spotless.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Spotless
on: push
permissions:
contents: write
jobs:
spotless:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- name: Add repository to git safe directories
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Check Spotless
id: spotlessCheck
continue-on-error: true
run: ./gradlew spotlessCheck
- name: Apply and Commit Linted File
if: ${{ steps.spotlessCheck.outcome == 'failure' }}
run: |
./gradlew spotlessApply
git config --global user.name 'Actions Bot'
git config --global user.email '[email protected]'
git commit -am "Automated Spotless Apply"
git push
git reset --soft HEAD~2
git commit -am"$(git log --format=%B --reverse HEAD..HEAD@{1})"