Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby

Fix mobile-build using tag name instead of branch for filenames

Claudeefcc3583d52c
diff --git a/.github/workflows/mobile-build.yml b/.github/workflows/mobile-build.yml
index 349b1195fc..38507c2738 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}"