From 1ee80930d4aacf46db8a0097304cce3e2694447a Mon Sep 17 00:00:00 2001 From: CaIon Date: Wed, 4 Feb 2026 00:13:47 +0800 Subject: [PATCH] fix(workflow): enhance tag resolution and error handling in Docker image build --- .github/workflows/docker-image-arm64.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-image-arm64.yml b/.github/workflows/docker-image-arm64.yml index 50630856b..5b01fd907 100644 --- a/.github/workflows/docker-image-arm64.yml +++ b/.github/workflows/docker-image-arm64.yml @@ -31,16 +31,21 @@ jobs: contents: read steps: - - name: Check out (shallow) + - name: Check out uses: actions/checkout@v4 with: - fetch-depth: 1 + fetch-depth: ${{ github.event_name == 'workflow_dispatch' && 0 || 1 }} + ref: ${{ github.event.inputs.tag || github.ref }} - name: Resolve tag & write VERSION run: | - git fetch --tags --force --depth=1 if [ -n "${{ github.event.inputs.tag }}" ]; then TAG="${{ github.event.inputs.tag }}" + # Verify tag exists + if ! git rev-parse "refs/tags/$TAG" >/dev/null 2>&1; then + echo "Error: Tag '$TAG' does not exist in the repository" + exit 1 + fi else TAG=${GITHUB_REF#refs/tags/} fi