diff --git a/scripts/commit-formatted-code.sh b/scripts/commit-formatted-code.sh index 24bba6f6b6..121cd4d6e3 100755 --- a/scripts/commit-formatted-code.sh +++ b/scripts/commit-formatted-code.sh @@ -13,4 +13,8 @@ else git checkout ${GITHUB_BRANCH} git commit -am "Format code" git push --set-upstream origin ${GITHUB_BRANCH} + # Fail so unformatted code never shows a green check. Pushes made with GITHUB_TOKEN don't start + # workflows, so the formatting commit is only checked once the author pushes again. + echo "::error::Unformatted code. Pushed a formatting commit; pull it and push again to re-run CI." + exit 1 fi