From 327bca8f11ef407e336b6cbef09147a79343a888 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Tue, 1 Dec 2026 11:10:18 +0100 Subject: [PATCH] ci(format): Fail Format Code when it had to format code Format Code pushed a formatting commit and then passed, so unformatted code showed a green check and the job could not gate a merge. It now fails after pushing the fix. The push uses GITHUB_TOKEN, which starts no workflows, so the formatting commit is checked once the author pushes again. Co-Authored-By: Claude Opus 5.5 --- scripts/commit-formatted-code.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/commit-formatted-code.sh b/scripts/commit-formatted-code.sh index 24bba6f6b6c..121cd4d6e3a 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