From dfa570962082cc5d32400bd09cd8a180906c18a9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 7 Dec 2025 16:18:04 +0000 Subject: [PATCH 1/3] Initial plan From f16b06307b3b3c3d1610b09291b5583d7f1d846c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 7 Dec 2025 16:21:06 +0000 Subject: [PATCH 2/3] Fix Windows/macOS/Linux build workflows: avoid case-insensitive tag conflict The issue was caused by two tags with different cases (V4.10.8 and v4.10.8) in the repository. On case-insensitive filesystems (Windows, macOS default), git fetch --tags fails with a reference conflict. Solution: Instead of fetching all tags, we now: 1. Check if the tag exists locally first (from checkout) 2. If not found locally, fetch only the specific tag needed 3. Handle fetch failures gracefully This avoids the case-insensitive filesystem conflict while still checking if tags exist. Co-authored-by: TanNhatCMS <113796420+TanNhatCMS@users.noreply.github.com> --- .github/workflows/build-linux.yml | 21 ++++++++++++++------- .github/workflows/build-macos.yml | 21 ++++++++++++++------- .github/workflows/build-windows.yml | 21 ++++++++++++++------- 3 files changed, 42 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 2043b82bb..e8e7a81d9 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -122,16 +122,23 @@ jobs: fi echo "Tag provided: $TAG" - # fetch tags from origin and check - git fetch --tags origin - if git rev-parse --verify --quiet "refs/tags/$TAG" >/dev/null; then + # Check if tag exists locally first (from checkout) + if git rev-parse --verify --quiet "refs/tags/$TAG" >/dev/null 2>&1; then echo "tag_provided=true" >> $GITHUB_OUTPUT echo "tag_exists=true" >> $GITHUB_OUTPUT - echo "Found tag $TAG on repo." + echo "Found tag $TAG locally." else - echo "tag_provided=true" >> $GITHUB_OUTPUT - echo "tag_exists=false" >> $GITHUB_OUTPUT - echo "Tag $TAG not found on repo. Will upload artifacts for manual download." + # Try to fetch the specific tag to avoid case-insensitive filesystem conflicts + echo "Tag not found locally, fetching specific tag from origin..." + if git fetch origin "refs/tags/$TAG:refs/tags/$TAG" 2>/dev/null; then + echo "tag_provided=true" >> $GITHUB_OUTPUT + echo "tag_exists=true" >> $GITHUB_OUTPUT + echo "Found and fetched tag $TAG from repo." + else + echo "tag_provided=true" >> $GITHUB_OUTPUT + echo "tag_exists=false" >> $GITHUB_OUTPUT + echo "Tag $TAG not found on repo. Will upload artifacts for manual download." + fi fi # If tag provided and exists -> attach to release (create/update release by tag) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 94fb6a4b3..eec1340d9 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -93,16 +93,23 @@ jobs: fi echo "Tag provided: $TAG" - # fetch tags from origin and check - git fetch --tags origin - if git rev-parse --verify --quiet "refs/tags/$TAG" >/dev/null; then + # Check if tag exists locally first (from checkout) + if git rev-parse --verify --quiet "refs/tags/$TAG" >/dev/null 2>&1; then echo "tag_provided=true" >> $GITHUB_OUTPUT echo "tag_exists=true" >> $GITHUB_OUTPUT - echo "Found tag $TAG on repo." + echo "Found tag $TAG locally." else - echo "tag_provided=true" >> $GITHUB_OUTPUT - echo "tag_exists=false" >> $GITHUB_OUTPUT - echo "Tag $TAG not found on repo. Will upload artifacts for manual download." + # Try to fetch the specific tag to avoid case-insensitive filesystem conflicts + echo "Tag not found locally, fetching specific tag from origin..." + if git fetch origin "refs/tags/$TAG:refs/tags/$TAG" 2>/dev/null; then + echo "tag_provided=true" >> $GITHUB_OUTPUT + echo "tag_exists=true" >> $GITHUB_OUTPUT + echo "Found and fetched tag $TAG from repo." + else + echo "tag_provided=true" >> $GITHUB_OUTPUT + echo "tag_exists=false" >> $GITHUB_OUTPUT + echo "Tag $TAG not found on repo. Will upload artifacts for manual download." + fi fi # If tag provided and exists -> attach to release (create/update release by tag) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 00b5cb2d9..33b4ebc6d 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -105,16 +105,23 @@ jobs: fi echo "Tag provided: $TAG" - # fetch tags from origin and check - git fetch --tags origin - if git rev-parse --verify --quiet "refs/tags/$TAG" >/dev/null; then + # Check if tag exists locally first (from checkout) + if git rev-parse --verify --quiet "refs/tags/$TAG" >/dev/null 2>&1; then echo "tag_provided=true" >> $GITHUB_OUTPUT echo "tag_exists=true" >> $GITHUB_OUTPUT - echo "Found tag $TAG on repo." + echo "Found tag $TAG locally." else - echo "tag_provided=true" >> $GITHUB_OUTPUT - echo "tag_exists=false" >> $GITHUB_OUTPUT - echo "Tag $TAG not found on repo. Will upload artifacts for manual download." + # Try to fetch the specific tag to avoid case-insensitive filesystem conflicts + echo "Tag not found locally, fetching specific tag from origin..." + if git fetch origin "refs/tags/$TAG:refs/tags/$TAG" 2>/dev/null; then + echo "tag_provided=true" >> $GITHUB_OUTPUT + echo "tag_exists=true" >> $GITHUB_OUTPUT + echo "Found and fetched tag $TAG from repo." + else + echo "tag_provided=true" >> $GITHUB_OUTPUT + echo "tag_exists=false" >> $GITHUB_OUTPUT + echo "Tag $TAG not found on repo. Will upload artifacts for manual download." + fi fi - name: Upload artifacts to GitHub Release (tag exists) From 90f957ab5a50e3b746da91b2c3061a5b1d054d94 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 7 Dec 2025 16:23:09 +0000 Subject: [PATCH 3/3] Improve consistency: use 2>/dev/null for error redirection Made error redirection consistent across all tag checking commands for better code clarity. Co-authored-by: TanNhatCMS <113796420+TanNhatCMS@users.noreply.github.com> --- .github/workflows/build-linux.yml | 2 +- .github/workflows/build-macos.yml | 2 +- .github/workflows/build-windows.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index e8e7a81d9..bd092a640 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -123,7 +123,7 @@ jobs: echo "Tag provided: $TAG" # Check if tag exists locally first (from checkout) - if git rev-parse --verify --quiet "refs/tags/$TAG" >/dev/null 2>&1; then + if git rev-parse --verify --quiet "refs/tags/$TAG" 2>/dev/null; then echo "tag_provided=true" >> $GITHUB_OUTPUT echo "tag_exists=true" >> $GITHUB_OUTPUT echo "Found tag $TAG locally." diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index eec1340d9..f227e06fb 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -94,7 +94,7 @@ jobs: echo "Tag provided: $TAG" # Check if tag exists locally first (from checkout) - if git rev-parse --verify --quiet "refs/tags/$TAG" >/dev/null 2>&1; then + if git rev-parse --verify --quiet "refs/tags/$TAG" 2>/dev/null; then echo "tag_provided=true" >> $GITHUB_OUTPUT echo "tag_exists=true" >> $GITHUB_OUTPUT echo "Found tag $TAG locally." diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 33b4ebc6d..5ef2d0b15 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -106,7 +106,7 @@ jobs: echo "Tag provided: $TAG" # Check if tag exists locally first (from checkout) - if git rev-parse --verify --quiet "refs/tags/$TAG" >/dev/null 2>&1; then + if git rev-parse --verify --quiet "refs/tags/$TAG" 2>/dev/null; then echo "tag_provided=true" >> $GITHUB_OUTPUT echo "tag_exists=true" >> $GITHUB_OUTPUT echo "Found tag $TAG locally."