diff --git a/.github/workflows/linter-irods-clang-format.yml b/.github/workflows/linter-irods-clang-format.yml index 32e0685..4b556fb 100644 --- a/.github/workflows/linter-irods-clang-format.yml +++ b/.github/workflows/linter-irods-clang-format.yml @@ -9,10 +9,20 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Clang Format + - name: Install ClangFormat run: | sudo apt-get install -y clang-format - - name: Run Clang-Format + - name: Run ClangFormat run: | - clang-format -n src/* | grep clang-formatted + echo warnings=$(clang-format -n src/* | wc -l) >> "$GITHUB_ENV" + + - run: | + echo "Source code is properly formatted."; + exit 0 + if: "$warnings" == "0" + + - run: | + echo "Source code needs to be formatted!"; + exit 1 + if: "$warnings" != "0"