Skip to content

Commit

Permalink
Added check for modified files
Browse files Browse the repository at this point in the history
  • Loading branch information
charlestian23 committed Mar 29, 2024
1 parent 6f69b0e commit 3b204ef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/java-autoformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ jobs:
- name: Run spotless
run: ./gradlew :spotlessApply

- name: Check for modified files
id: git-check
run: echo "modified=$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)" >> $GITHUB_OUTPUT

- name: Create temporary branch
if: steps.git-check.outputs.modified == 'true'
run: |
git config --global user.name 'Bram van Heuveln'
git config --global user.email '[email protected]'
Expand All @@ -39,6 +44,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Open pull request
if: steps.git-check.outputs.modified == 'true'
uses: peter-evans/create-pull-request@v3
with:
title: Automated Java code formatting changes
Expand Down

0 comments on commit 3b204ef

Please sign in to comment.