diff --git a/.github/actions/javascript/getPullRequestDetails/getPullRequestDetails.js b/.github/actions/javascript/getPullRequestDetails/getPullRequestDetails.js index cf3f27ee662c..15ee2869a14d 100644 --- a/.github/actions/javascript/getPullRequestDetails/getPullRequestDetails.js +++ b/.github/actions/javascript/getPullRequestDetails/getPullRequestDetails.js @@ -87,9 +87,13 @@ if (pullRequestNumber) { ...DEFAULT_PAYLOAD, state: 'all', }) + .then(({data}) => _.find(data, PR => PR.user.login === user && titleRegex.test(PR.title)).number) + .then(matchingPRNum => GithubUtils.octokit.pulls.get({ + ...DEFAULT_PAYLOAD, + pull_number: matchingPRNum, + })) .then(({data}) => { - const matchingPR = _.find(data, PR => PR.user.login === user && titleRegex.test(PR.title)); - outputMergeCommitHash(matchingPR); - outputMergeActor(matchingPR); + outputMergeCommitHash(data); + outputMergeActor(data); }); } diff --git a/.github/actions/javascript/getPullRequestDetails/index.js b/.github/actions/javascript/getPullRequestDetails/index.js index 692751956bbf..b06196149058 100644 --- a/.github/actions/javascript/getPullRequestDetails/index.js +++ b/.github/actions/javascript/getPullRequestDetails/index.js @@ -97,10 +97,14 @@ if (pullRequestNumber) { ...DEFAULT_PAYLOAD, state: 'all', }) + .then(({data}) => _.find(data, PR => PR.user.login === user && titleRegex.test(PR.title)).number) + .then(matchingPRNum => GithubUtils.octokit.pulls.get({ + ...DEFAULT_PAYLOAD, + pull_number: matchingPRNum, + })) .then(({data}) => { - const matchingPR = _.find(data, PR => PR.user.login === user && titleRegex.test(PR.title)); - outputMergeCommitHash(matchingPR); - outputMergeActor(matchingPR); + outputMergeCommitHash(data); + outputMergeActor(data); }); }