Skip to content

Commit a9bd82d

Browse files
authored
update workflow to format swift and objective c code (MaikuB#1407)
1 parent a5a84f0 commit a9bd82d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

.github/workflows/format.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ name: format
33
on: push
44

55
jobs:
6-
76
java_format:
87
runs-on: ubuntu-latest
98
steps:
109
- uses: actions/checkout@v2 # v2 minimum required
1110
- uses: axel-op/googlejavaformat-action@v3
1211
with:
13-
args: "--skip-sorting-imports --replace"
12+
args: '--skip-sorting-imports --replace'
1413

1514
objc_format:
1615
runs-on: macos-latest
@@ -22,7 +21,7 @@ jobs:
2221
find . -name '*.m' -exec clang-format -i {} \;
2322
find . -path '*/ios/**/*.h' -exec clang-format -i {} \;
2423
find . -path '*/macos/**/*.h' -exec clang-format -i {} \;
25-
git diff --exit-code
24+
git diff --exit-code || (git commit --all -m "Clang Format" && git push)
2625
2726
swift_format:
2827
runs-on: macos-latest
@@ -32,4 +31,4 @@ jobs:
3231
run: |
3332
which swiftlint || brew install swiftlint
3433
swiftlint --fix
35-
git diff --exit-code
34+
git diff --exit-code || (git commit --all -m "Swift Format" && git push)

0 commit comments

Comments
 (0)