From a87aa4ccdbee54faafab6391006aa9bcee95d856 Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Fri, 16 Oct 2026 22:28:40 -0700 Subject: [PATCH] ci(mobile): merge the Android APK download bump on the site after its checks pass (#29981) --- .github/workflows/mobile-android-release.yml | 22 +++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mobile-android-release.yml b/.github/workflows/mobile-android-release.yml index 2f502341dc9..611510a2331 100644 --- a/.github/workflows/mobile-android-release.yml +++ b/.github/workflows/mobile-android-release.yml @@ -275,7 +275,7 @@ jobs: path: site token: ${{ steps.app-token.outputs.token }} - - name: Open the version bump PR + - name: Open and merge the version bump PR working-directory: site env: GH_TOKEN: ${{ steps.app-token.outputs.token }} @@ -303,6 +303,26 @@ jobs: fi echo "Android APK download bump: $pr" >> "$GITHUB_STEP_SUMMARY" + # Why wait for checks: they push a deploy commit onto the branch (merging first fails with + # "Head branch was modified"), and a failed site build must not merge. Main's push deploys. + sleep 20 + gh pr checks "$pr" --repo "$SITE_REPO" --watch --interval 15 || true + failed="$(gh pr checks "$pr" --repo "$SITE_REPO" --json bucket --jq 'map(select(.bucket == "fail")) | length' 2>/dev/null || true)" + # The deploy commit is [skip ci], so the final head may report no checks at all. + if [ "${failed:-0}" != "0" ]; then + echo "::warning::The site's checks failed on $pr; not merging. Fix and merge it by hand." + exit 1 + fi + for _ in 1 2 3; do + if gh pr merge "$pr" --repo "$SITE_REPO" --squash --delete-branch; then + echo "Merged; the site deploys from main." >> "$GITHUB_STEP_SUMMARY" + exit 0 + fi + sleep 30 + done + echo "::warning::Could not merge $pr; merge it by hand to update /download/android." + exit 1 + - name: Report a failed bump if: failure() run: |