Skip to content

Commit 66b4dce

Browse files
transphormCodeRabbit
andcommitted
chore: fix build versions v2.6.9 and mobile deploy fork pr source (#1224)
* chore: bump iOS build number to 179 * fix: use PR source commit for deployment to get correct version.json When deploying from a PR merge (e.g., dev → staging), now uses the source branch's commit instead of always checking out staging. This ensures version.json has the correct bumped build number from the previous deployment's PR back to dev, preventing 'build number already exists' errors. * downgrade to match store * fix: use merge_commit_sha instead of head.sha for deployments Use github.event.pull_request.merge_commit_sha instead of head.sha to ensure we deploy exactly what landed on staging after the merge, not just the source branch state. This correctly handles: - Conflict resolutions made during merge - Any staging-only changes - The actual state of staging post-merge The merge commit still includes the updated version.json from the source branch (e.g., dev), so build numbers remain correct while ensuring we deploy and tag the true staging state. Co-authored-by: CodeRabbit <[email protected]> --------- Co-authored-by: CodeRabbit <[email protected]>
1 parent 1f51a5f commit 66b4dce

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/workflows/mobile-deploy.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ jobs:
135135
- uses: actions/checkout@v4
136136
with:
137137
fetch-depth: 0
138-
ref: staging
138+
# When triggered by PR merge, use the merge commit on staging
139+
# This ensures we deploy exactly what landed on staging (including version.json from source + any conflict resolutions)
140+
ref: ${{ github.event.pull_request.merge_commit_sha || 'staging' }}
139141
- name: Read and sanitize Node.js version
140142
shell: bash
141143
run: |
@@ -160,7 +162,11 @@ jobs:
160162
echo "Staging HEAD commit: $(git rev-parse origin/staging)"
161163
echo "Staging HEAD message: $(git log -1 --pretty=format:'%s' origin/staging)"
162164
163-
if [ "$(git rev-parse HEAD)" != "$(git rev-parse origin/staging)" ]; then
165+
if [ "${{ github.event_name }}" = "pull_request" ]; then
166+
echo "📌 Building from merge commit on staging (includes source + conflict resolutions)"
167+
echo "PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}"
168+
echo "Merge commit includes version.json from source branch with bumped build numbers"
169+
elif [ "$(git rev-parse HEAD)" != "$(git rev-parse origin/staging)" ]; then
164170
echo "⚠️ WARNING: Current commit differs from latest staging commit"
165171
echo "This might indicate we're not building from the latest staging branch"
166172
git log --oneline HEAD..origin/staging || true
@@ -656,7 +662,9 @@ jobs:
656662
if: inputs.platform != 'ios'
657663
with:
658664
fetch-depth: 0
659-
ref: staging
665+
# When triggered by PR merge, use the merge commit on staging
666+
# This ensures we deploy exactly what landed on staging (including version.json from source + any conflict resolutions)
667+
ref: ${{ github.event.pull_request.merge_commit_sha || 'staging' }}
660668
- uses: "google-github-actions/auth@v2"
661669
with:
662670
project_id: "plucky-tempo-454713-r0"
@@ -1128,7 +1136,9 @@ jobs:
11281136
- uses: actions/checkout@v4
11291137
with:
11301138
fetch-depth: 0
1131-
ref: staging
1139+
# When triggered by PR merge, use the merge commit on staging
1140+
# This ensures we tag exactly what landed on staging (including version.json from source + any conflict resolutions)
1141+
ref: ${{ github.event.pull_request.merge_commit_sha || 'staging' }}
11321142
token: ${{ secrets.GITHUB_TOKEN }}
11331143

11341144
- name: Configure Git

0 commit comments

Comments
 (0)