fix(ci): add fallback to 'latest' when TAG_NAMES is empty in DockerHub push logic

This commit is contained in:
Haitao Pan 2025-12-06 23:00:57 +08:00
parent 56308f75cc
commit 183fe971c4
2 changed files with 8 additions and 0 deletions

View File

@ -128,6 +128,10 @@ jobs:
docker pull "$ORIGIN_IMG"
for TAG in $TAG_NAMES; do
if [ -z "$TAGS" ]; then
echo "TAG_NAMES is empty, falling back to 'latest'"
TAGS="latest"
fi
docker tag "$ORIGIN_IMG" "$TARGET_REPO:$TAG"
docker push "$TARGET_REPO:$TAG"
done

View File

@ -163,6 +163,10 @@ jobs:
docker pull "$ORIGIN_IMG"
for TAG in $TAG_NAMES; do
if [ -z "$TAGS" ]; then
echo "TAG_NAMES is empty, falling back to 'latest'"
TAGS="latest"
fi
docker tag "$ORIGIN_IMG" "$TARGET_REPO:$TAG"
docker push "$TARGET_REPO:$TAG"
done