From efcc3583d52c1e9c136bc46fb60c976b84ac9435 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Feb 2026 23:10:39 +0000 Subject: [PATCH] Fix mobile-build using tag name instead of branch for filenames When workflow_dispatch is triggered from a tag (e.g. v0.6.7) instead of a branch, github.ref_name returns the tag name, causing filenames like sure-v0.6.7-{stamp}.apk instead of sure-main-{stamp}.apk. Guard against this by checking github.ref_type and falling back to the repository's default branch when a tag is selected. https://claude.ai/code/session_01TDfNkNxQ6uWxQxLAwJY5Qa --- .github/workflows/mobile-build.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mobile-build.yml b/.github/workflows/mobile-build.yml index 349b1195f..38507c273 100644 --- a/.github/workflows/mobile-build.yml +++ b/.github/workflows/mobile-build.yml @@ -26,7 +26,13 @@ jobs: # Sanitise branch name for use in file names and git tags # e.g. feature/foo-bar → feature-foo-bar - RAW_BRANCH="${{ github.ref_name }}" + # When workflow_dispatch is triggered from a tag, fall back to the + # default branch so filenames use "main" instead of the tag name. + if [[ "${{ github.ref_type }}" == "tag" ]]; then + RAW_BRANCH="${{ github.event.repository.default_branch }}" + else + RAW_BRANCH="${{ github.ref_name }}" + fi BRANCH="$(echo "$RAW_BRANCH" | sed 's/[^a-zA-Z0-9._-]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//')" VERSION="${BRANCH}-${STAMP}"