ci: sanitize branch name when naming test APK in reusable-build
The 'Rename apk file'/'Find APK file' steps used the raw ${BRANCH_NAME} as an APK filename, so any branch containing a '/' (e.g. claude/*) made cp target a non-existent test-apk/<prefix>/ subdirectory and failed the build. Derive the sanitized branch name from android/app.properties, the same approach already used in automated_integration_test.yml.
sethforprivacy committed
Jul 24, 2026 at 13:56 UTC
c50d0fc6dd0299443f046bef6eb0197f859d841e
1 file changed
+5
-3
.github/workflows/reusable-build.yml
+5
-3
@@ -176,16 +176,18 @@ jobs:
176
177
- name: Rename apk file
178
run: |
179
+ sanitized_branch_name=$(grep '^id=' android/app.properties | cut -d'=' -f2 | sed 's/com\.cakewallet\.test_//')
180
cd build/app/outputs/flutter-apk
181
mkdir test-apk
181
- cp app-arm64-v8a-release.apk test-apk/${BRANCH_NAME}.apk
182
- cp app-x86_64-release.apk test-apk/${BRANCH_NAME}_x86.apk
182
+ cp app-arm64-v8a-release.apk test-apk/${sanitized_branch_name}.apk
183
+ cp app-x86_64-release.apk test-apk/${sanitized_branch_name}_x86.apk
184
185
- name: Find APK file
186
id: find_apk
187
run: |
188
set -x
188
- apk_file=$(ls build/app/outputs/flutter-apk/test-apk/${BRANCH_NAME}.apk || exit 1)
189
+ sanitized_branch_name=$(grep '^id=' android/app.properties | cut -d'=' -f2 | sed 's/com\.cakewallet\.test_//')
190
+ apk_file=$(ls build/app/outputs/flutter-apk/test-apk/${sanitized_branch_name}.apk || exit 1)
191
echo "APK_FILE=$apk_file" >> $GITHUB_ENV
192
- name: Write BRANCH_NAME to env
193
run: echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV