Skip to content

Commit

Permalink
Apply clang-format to code
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelLerchner committed Nov 16, 2023
1 parent 27cceb1 commit 00f2a3f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,29 @@ jobs:
mkdir -p build && cd build
cmake ..
make clangformat
- name: Quit if there are no changes
run: |
if [[ -z $(git status -s) ]]; then
echo "No changes to the formatting."
exit 0
fi
- name: Check if there are any changes
id: verify_diff
run: |
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT
- name: Commit changes
if: steps.verify_diff.outputs.changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -am "Apply clang-format"
- name: Push changes
if: steps.verify_diff.outputs.changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}

0 comments on commit 00f2a3f

Please sign in to comment.