tools: Make tool name branch/tag push atomic

This commit is contained in:
Taiki Endo
2025-12-18 22:14:21 +09:00
parent 029c22f1bf
commit a16c289c87

View File

@@ -145,6 +145,7 @@ tools+=(
# Non-manifest-based tools. # Non-manifest-based tools.
tools+=(valgrind) tools+=(valgrind)
refs=()
for tool in "${tools[@]}"; do for tool in "${tools[@]}"; do
git checkout -b "${tool}" git checkout -b "${tool}"
sed -E "${in_place[@]}" action.yml \ sed -E "${in_place[@]}" action.yml \
@@ -152,12 +153,12 @@ for tool in "${tools[@]}"; do
-e "s/# default: #publish:tool/default: ${tool}/g" -e "s/# default: #publish:tool/default: ${tool}/g"
git add action.yml git add action.yml
git commit -m "${tool}" git commit -m "${tool}"
retry git push origin -f refs/heads/"${tool}"
git tag -f "${tool}" git tag -f "${tool}"
retry git push origin -f refs/tags/"${tool}"
git checkout main git checkout main
git branch -D "${tool}" refs+=(refs/heads/"${tool}" refs/tags/"${tool}")
done done
retry git push origin --atomic -f "${refs[@]}"
git branch -D "${tools[@]}"
schema_workspace=/tmp/workspace schema_workspace=/tmp/workspace
rm -rf -- "${schema_workspace}" rm -rf -- "${schema_workspace}"