From 72222e3cd78f1adf448abe676b956bbe30a01181 Mon Sep 17 00:00:00 2001 From: Satish Ravi Date: Tue, 30 Apr 2024 11:41:25 -0700 Subject: [PATCH] ci: upload detox build to emerge on merge queue runs (#5360) ### Description Some main runs fail to upload this because E2E-main runs are skipped if multiple PRs merge at the same time (or if some fail due to test flake). This ensures a commit on main always uploads a build to emerge. More context here: https://valora-app.slack.com/archives/C02E2FE98P2/p1713968251987719 ### Test plan Watch CI run on merge queue ### Related issues N/A ### Backwards compatibility N/A ### Network scalability N/A --- .github/scripts/uploadE2eBuildToEmerge.ts | 5 +++++ .github/workflows/e2e-ios.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/scripts/uploadE2eBuildToEmerge.ts b/.github/scripts/uploadE2eBuildToEmerge.ts index 943f12d47c3..5456838c4ef 100644 --- a/.github/scripts/uploadE2eBuildToEmerge.ts +++ b/.github/scripts/uploadE2eBuildToEmerge.ts @@ -30,6 +30,11 @@ function getGitHubInfo() { // Get the SHA of the previous commit, which will be the baseSha in the case of a push event. baseSha = eventFileJson?.before ?? '' branchName = process.env.GITHUB_REF_NAME ?? '' + } else if (process.env.GITHUB_EVENT_NAME === 'merge_group') { + sha = process.env.GITHUB_SHA ?? '' + // Get the SHA of the base commit, which will be the base_sha in the case of a merge_group event. + baseSha = eventFileJson?.merge_group?.base_sha ?? '' + branchName = process.env.GITHUB_REF_NAME ?? '' } else { throw new Error(`Unsupported action trigger: ${process.env.GITHUB_EVENT_NAME}`) } diff --git a/.github/workflows/e2e-ios.yml b/.github/workflows/e2e-ios.yml index b1fa21915b6..b2d58c866a6 100644 --- a/.github/workflows/e2e-ios.yml +++ b/.github/workflows/e2e-ios.yml @@ -56,7 +56,7 @@ jobs: - name: Upload Detox Build to Emerge if: | env.SECRETS_AVAILABLE - && (github.event_name == 'pull_request' || github.event_name == 'push') + && (github.event_name == 'pull_request' || github.event_name == 'push' || github.event_name == 'merge_group') run: yarn ts-node .github/scripts/uploadE2eBuildToEmerge.ts env: EMERGE_API_TOKEN: ${{ steps.google-secrets.outputs.EMERGE_API_TOKEN }}