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

(cherry picked from commit 7747acd)
  • Loading branch information
Julesssss authored and OSBotify committed Sep 7, 2022
1 parent 0caf404 commit a5b5d58
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 a5b5d58

Please sign in to comment.