From a13bd9f1df2a00cd06783cbdd5153bf063232087 Mon Sep 17 00:00:00 2001 From: Lazlo Westerhof Date: Mon, 11 Mar 2024 12:04:24 +0100 Subject: [PATCH] YDA-5623: fail workflow if code is not properly formatted --- .github/workflows/linter-irods-clang-format.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/linter-irods-clang-format.yml b/.github/workflows/linter-irods-clang-format.yml index 8e8e163..ac5d0b2 100644 --- a/.github/workflows/linter-irods-clang-format.yml +++ b/.github/workflows/linter-irods-clang-format.yml @@ -16,3 +16,13 @@ jobs: - name: Run ClangFormat run: | echo "warnings=$(clang-format -n src/* | wc -l)" >> "$GITHUB_ENV" + + - run: | + echo "Source code is properly formatted."; + exit 1 + if: ${{ env.warnings }} == 0 + + - run: | + echo "Source code needs to be formatted! "; + exit 1 + if: ${{ env.warnings }} != 0