Skip to content

Commit

Permalink
ci: upload detox build to emerge on merge queue runs (valora-inc#5360)
Browse files Browse the repository at this point in the history
### 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
  • Loading branch information
satish-ravi authored and shottah committed May 15, 2024
1 parent 0c036f8 commit 72222e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/scripts/uploadE2eBuildToEmerge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit 72222e3

Please sign in to comment.