-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (32 loc) · 1.02 KB
/
java-format.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
34
35
36
37
name: Google Java Style Format
on:
pull_request:
branches: [ master, develop ]
jobs:
java-formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
- name: Check for Java files
id: check_java_files
run: |
if [ -n "$(find . -name '*.java' -print -quit)" ]; then
echo "java_files_exist=true" >> $GITHUB_STATE
else
echo "java_files_exist=false" >> $GITHUB_STATE
fi
- name: Google Java Style Format
if: steps.check_java_files.outputs.java_files_exist == 'true'
uses: axel-op/googlejavaformat-action@v3
with:
# --aosp: 4-space indentation
args: "--replace --aosp"
# Can not auto commit, we'll commit manually
skip-commit: true
- name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Apply Google Java Style Format"