Skip to content

Commit fba909b

Browse files
authored
Update build.yml
1 parent 4b5af5d commit fba909b

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/build.yml

+16-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
branches: [ "master" ]
1515

1616
permissions:
17-
contents: read
17+
contents: write
1818

1919
jobs:
2020
build:
@@ -32,5 +32,20 @@ jobs:
3232
- name: Setup Gradle
3333
uses: gradle/actions/setup-gradle@v3
3434

35+
- name: Format code
36+
run: ./gradlew ktlintFormat
37+
3538
- name: Execute Gradle build
3639
run: ./gradlew build
40+
41+
- name: Commit formatted code
42+
run: |
43+
if [[ -n $(git status --porcelain) ]]; then
44+
git config --local user.name 'github-actions[bot]'
45+
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'
46+
git add --all
47+
git commit -m "gradlew ktlintFormat"
48+
git push
49+
else
50+
echo "No changes to the output on this push; exiting."
51+
fi

0 commit comments

Comments
 (0)