From 258313fcbb8fe8bf33fe3be974b3cb01115108b2 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 21 Jan 2026 22:40:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=AD=A3=E5=89=87=E8=A1=A8=E9=81=94?= =?UTF-8?q?=E5=BC=8F=E6=94=AF=E6=8F=B4=E4=BB=BB=E6=84=8F=E6=95=B8=E9=87=8F?= =?UTF-8?q?=E7=9A=84=E7=89=88=E6=9C=AC=E6=95=B8=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 舊規則:^[0-9]+\.[0-9]+\.[0-9]+$ (僅 X.Y.Z) - 新規則:^[0-9]+(\.[0-9]+)+$ (支援 X.Y.Z.W...) - 0.1.10 → latest ✓ - 0.1.10.1 → latest ✓ - 0.1.10.test → 不加 latest --- .github/workflows/docker-build-remote.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-build-remote.yml b/.github/workflows/docker-build-remote.yml index 29644e4..ba0b21d 100644 --- a/.github/workflows/docker-build-remote.yml +++ b/.github/workflows/docker-build-remote.yml @@ -301,9 +301,9 @@ jobs: echo "========================================" echo "映像名稱: ${{ env.DOCKER_IMAGE_REPO }}:${{ github.event.inputs.image_tag }}" - # 判斷是否為正式版本(純數字+點號) + # 判斷是否為正式版本(純數字+點號,支援任意段數如 0.1.10 或 0.1.10.1) IMAGE_TAG="${{ github.event.inputs.image_tag }}" - if [[ "$IMAGE_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + if [[ "$IMAGE_TAG" =~ ^[0-9]+(\.[0-9]+)+$ ]]; then echo "✅ 正式版本,將同時標記 latest" ADD_LATEST="true" else @@ -394,9 +394,9 @@ jobs: echo "========================================" echo "映像: ${{ env.DOCKER_IMAGE_REPO }}:${{ github.event.inputs.image_tag }}" - # 判斷是否為正式版本(純數字+點號) + # 判斷是否為正式版本(純數字+點號,支援任意段數如 0.1.10 或 0.1.10.1) IMAGE_TAG="${{ github.event.inputs.image_tag }}" - if [[ "$IMAGE_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + if [[ "$IMAGE_TAG" =~ ^[0-9]+(\.[0-9]+)+$ ]]; then echo "✅ 正式版本,將同時推送 latest" ADD_LATEST="true" else @@ -585,9 +585,9 @@ jobs: echo "📦 映像資訊:" echo " - 版本標籤: ${{ env.DOCKER_IMAGE_REPO }}:${{ github.event.inputs.image_tag }}" - # 判斷是否為正式版本 + # 判斷是否為正式版本(純數字+點號) IMAGE_TAG="${{ github.event.inputs.image_tag }}" - if [[ "$IMAGE_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + if [[ "$IMAGE_TAG" =~ ^[0-9]+(\.[0-9]+)+$ ]]; then echo " - Latest 標籤: ${{ env.DOCKER_IMAGE_REPO }}:latest ✅" else echo " - Latest 標籤: (測試版本,未更新)" @@ -606,7 +606,7 @@ jobs: echo "" echo "📝 使用方式:" echo " docker pull ${{ env.DOCKER_IMAGE_REPO }}:${{ github.event.inputs.image_tag }}" - if [[ "$IMAGE_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + if [[ "$IMAGE_TAG" =~ ^[0-9]+(\.[0-9]+)+$ ]]; then echo " docker pull ${{ env.DOCKER_IMAGE_REPO }}:latest" fi echo ""