merge-after-ci: don't run treefmt on uncommitted changes

stash changes before running formatter
This commit is contained in:
DavHau
2024-09-09 20:51:37 +02:00
parent 5bc6cff384
commit 52dfee1d80

View File

@@ -29,7 +29,15 @@ if ! check_remote "$remoteUpstream"; then
exit 1
fi
treefmt --fail-on-change --no-cache
# run formatting on a clean working tree
echo "stashing uncommitted changes to run treefmt"
git stash push
if ! treefmt --fail-on-change --no-cache; then
git stash pop
exit 1
fi
git stash pop
upstream_url=$(git remote get-url "$remoteUpstream")
set -x