From a16c289c87d9573c5d0ca86f8ea0db4fa677af09 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Thu, 18 Dec 2025 22:14:21 +0900 Subject: [PATCH] tools: Make tool name branch/tag push atomic --- tools/publish.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/publish.sh b/tools/publish.sh index c3b96134..2680b861 100755 --- a/tools/publish.sh +++ b/tools/publish.sh @@ -145,6 +145,7 @@ tools+=( # Non-manifest-based tools. tools+=(valgrind) +refs=() for tool in "${tools[@]}"; do git checkout -b "${tool}" sed -E "${in_place[@]}" action.yml \ @@ -152,12 +153,12 @@ for tool in "${tools[@]}"; do -e "s/# default: #publish:tool/default: ${tool}/g" git add action.yml git commit -m "${tool}" - retry git push origin -f refs/heads/"${tool}" git tag -f "${tool}" - retry git push origin -f refs/tags/"${tool}" git checkout main - git branch -D "${tool}" + refs+=(refs/heads/"${tool}" refs/tags/"${tool}") done +retry git push origin --atomic -f "${refs[@]}" +git branch -D "${tools[@]}" schema_workspace=/tmp/workspace rm -rf -- "${schema_workspace}"