Skip to content

Commit b9643cd

Browse files
authored
Merge pull request #31161 from Expensify/Rory-FixDeployComments
[No QA] Trust input tag and diff between it and the most recent completed deploy
2 parents a2d5128 + 19ab19d commit b9643cd

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

.github/actions/javascript/getDeployPullRequestList/getDeployPullRequestList.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,7 @@ async function run() {
2323
})
2424
).data.workflow_runs;
2525

26-
const inputTagIndex = _.findIndex(completedDeploys, (workflowRun) => workflowRun.head_branch === inputTag);
27-
if (inputTagIndex < 0) {
28-
throw new Error(`No completed deploy found for input tag ${inputTag}`);
29-
}
30-
31-
const priorTag = completedDeploys[inputTagIndex + 1].head_branch;
26+
const priorTag = _.first(completedDeploys).head_branch;
3227
console.log(`Looking for PRs deployed to ${deployEnv} between ${priorTag} and ${inputTag}`);
3328
const prList = await GitUtils.getPullRequestsMergedBetween(priorTag, inputTag);
3429
console.log(`Found the pull request list: ${prList}`);

.github/actions/javascript/getDeployPullRequestList/index.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,7 @@ async function run() {
3232
})
3333
).data.workflow_runs;
3434

35-
const inputTagIndex = _.findIndex(completedDeploys, (workflowRun) => workflowRun.head_branch === inputTag);
36-
if (inputTagIndex < 0) {
37-
throw new Error(`No completed deploy found for input tag ${inputTag}`);
38-
}
39-
40-
const priorTag = completedDeploys[inputTagIndex + 1].head_branch;
35+
const priorTag = _.first(completedDeploys).head_branch;
4136
console.log(`Looking for PRs deployed to ${deployEnv} between ${priorTag} and ${inputTag}`);
4237
const prList = await GitUtils.getPullRequestsMergedBetween(priorTag, inputTag);
4338
console.log(`Found the pull request list: ${prList}`);

0 commit comments

Comments
 (0)