This repository has been archived by the owner on May 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #223 from nodaguti/assign-reviewers
Send review requests when assigning reviewers
- Loading branch information
Showing
2 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* @param {import('@octokit/rest').Octokit} aOctoKit | ||
* @param {string} owner | ||
* @param {string} repo | ||
* @param {number} issueOrPullNumber | ||
* @return {Promise<boolean>} | ||
*/ | ||
export async function isPullRequest(aOctoKit, owner, repo, issueOrPullNumber) { | ||
try { | ||
await aOctoKit.pulls.get({ | ||
owner, | ||
repo, | ||
// eslint-disable-next-line camelcase | ||
pull_number: issueOrPullNumber, | ||
}); | ||
|
||
return true; | ||
} catch (_e) { | ||
return false; | ||
} | ||
} |