Skip to content

Commit bfe65cd

Browse files
refactor(tag_release): consolidate tag pushing since there are no contraints that would effect our registry size for pushing in a single line. this also changes the tagging process to use the atomic option to make the tag script an all or nothing success or fail for tagging.
1 parent 99ed86c commit bfe65cd

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

.github/scripts/tag_release.sh

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -191,26 +191,31 @@ create_and_push_tags() {
191191

192192
echo "🚀 Pushing tags to origin..."
193193

194-
local pushed_tags=0
195-
local failed_pushes=0
196-
194+
local tags_to_push=()
197195
for module_info in "${MODULES_TO_TAG[@]}"; do
198196
IFS=':' read -r module_path namespace module_name version <<< "$module_info"
199-
200197
local tag_name="release/$namespace/$module_name/v$version"
201-
198+
202199
if git rev-parse --verify "$tag_name" > /dev/null 2>&1; then
203-
echo "Pushing: $tag_name"
204-
if git push origin "$tag_name"; then
205-
echo "✅ Pushed: $tag_name"
206-
pushed_tags=$((pushed_tags + 1))
207-
else
208-
echo "❌ Failed to push: $tag_name"
209-
failed_pushes=$((failed_pushes + 1))
210-
fi
200+
tags_to_push+=("$tag_name")
211201
fi
212202
done
213203

204+
local pushed_tags=0
205+
local failed_pushes=0
206+
207+
if [ ${#tags_to_push[@]} -eq 0 ]; then
208+
echo "❌ No valid tags found to push"
209+
else
210+
if git push --atomic origin "${tags_to_push[@]}"; then
211+
echo "✅ Successfully pushed all ${#tags_to_push[@]} tags"
212+
pushed_tags=${#tags_to_push[@]}
213+
else
214+
echo "❌ Failed to push tags"
215+
failed_pushes=${#tags_to_push[@]}
216+
fi
217+
fi
218+
214219
echo ""
215220
echo "📊 Push summary:"
216221
echo " Pushed: $pushed_tags"

0 commit comments

Comments
 (0)