diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d341deb55d..23c3fd56c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,6 +76,13 @@ jobs: run: | uncrustify --version find . -not -path '.*catch_assert.h' -iname "*.[hc]" -exec uncrustify --check -c tools/uncrustify.cfg {} + + if [ "$?" = "0" ]; then + exit 0 + else + echo -e "\033[31;1;43mFormatting check (using Uncrustify) failed...\033[0m" + echo -e "\033[32;3mTo have the code uncrustified for you, please comment '/bot run uncrustify' (without the quotes) on the Pull Request.\033[0m" + exit 1 + fi - name: Check For Trailing Whitespace run: | set +e diff --git a/.github/workflows/uncrustify.yml b/.github/workflows/uncrustify.yml index cfb3821062..1996aca913 100644 --- a/.github/workflows/uncrustify.yml +++ b/.github/workflows/uncrustify.yml @@ -40,6 +40,7 @@ jobs: run: | uncrustify --version find . -not -path '.*catch_assert.h' -iname "*.[hc]" -exec uncrustify -c tools/uncrustify.cfg --no-backup --replace {} + + find . -not -path '.*catch_assert.h' -iname "*.[hc]" -exec uncrustify -c tools/uncrustify.cfg --no-backup --replace {} + - name: Push changes to upstream repository run: | git config --global user.name 'GitHub Action'