File tree Expand file tree Collapse file tree 2 files changed +2
-12
lines changed
.github/actions/javascript/getDeployPullRequestList Expand file tree Collapse file tree 2 files changed +2
-12
lines changed Original file line number Diff line number Diff 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 } ` ) ;
Original file line number Diff line number Diff 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}`);
You can’t perform that action at this time.
0 commit comments