Skip to content

Commit

Permalink
YDA-5623: fail workflow if code is not properly formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed Mar 11, 2024
1 parent 3001fe1 commit e8bce88
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/linter-irods-clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,15 @@ jobs:
- name: Run ClangFormat
run: |
echo "warnings=$(clang-format -n src/* | wc -l)" >> "$GITHUB_ENV"
- name: Source code is properly formatted
run: |
echo "Source code is properly formatted.";
exit 0
if: ${{ env.warnings }} == "0"

- name: Source code needs to be formatted
run: |
echo "Source code needs to be formatted!";
exit 1
if: ${{ env.warnings }} != "0"

0 comments on commit e8bce88

Please sign in to comment.