Skip to content

Commit e72f25e

Browse files
commit changes
1 parent 5356b89 commit e72f25e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/checkstyle.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ jobs:
1818
uses: actions/setup-java@v1
1919
with:
2020
java-version: 12
21-
- name: Google Java format
21+
- name: Gooogle Java Formatter
2222
run: |
2323
wget https://github.com/google/google-java-format/releases/download/google-java-format-1.9/google-java-format-1.9-all-deps.jar -O formatter.jar
2424
java -jar formatter.jar --replace --set-exit-if-changed $(find . -type f -name "*.java" | grep ".*/src/.*java")
25+
- name: Commit formatted changes
26+
if: failure()
27+
run: |
28+
black .
29+
git config --global user.name github-actions
30+
git config --global user.email '${GITHUB_ACTOR}@users.noreply.github.com'
31+
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
32+
git commit -am "Formatted with Google Java Format"
33+
git push --force origin HEAD:$GITHUB_REF

0 commit comments

Comments
 (0)