mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 16:47:34 +00:00
ci(mobile): merge the Android APK download bump on the site after its checks pass (#29981)
This commit is contained in:
@@ -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: |
|
||||
|
||||
Reference in New Issue
Block a user