Skip to content

Commit

Permalink
Merge pull request #10856 from Expensify/Rory-FixGetPRDetails
Browse files Browse the repository at this point in the history
[No QA] Fetch full PR object to fix CPs
  • Loading branch information
Julesssss authored Sep 7, 2022
2 parents 909c5da + 4126578 commit 7747acd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
10 changes: 7 additions & 3 deletions .github/actions/javascript/getPullRequestDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}

Expand Down

0 comments on commit 7747acd

Please sign in to comment.