@@ -4,7 +4,7 @@ import { Endpoints } from "@octokit/types"
44
55type pullRequest = Endpoints [ "GET /repos/{owner}/{repo}/pulls/{pull_number}" ] [ "response" ]
66
7- export async function searchCodePR ( octokit : Octokit , prNumber : string , repoName : string , owner : string ) : Promise < pullRequest [ 'data' ] | undefined > {
7+ export async function searchCodePR ( octokit : Octokit , prNumber : number , repoName : string , owner : string ) : Promise < pullRequest [ 'data' ] | undefined > {
88
99 const res = await doRequest ( octokit , prNumber , repoName , owner )
1010
@@ -13,7 +13,7 @@ export async function searchCodePR(octokit: Octokit, prNumber: string, repoName:
1313 const match = res . data . title . match ( re )
1414 if ( match ) {
1515 const originalRepoName = match [ 1 ]
16- const originalPrNumber = match [ 3 ]
16+ const originalPrNumber = parseInt ( match [ 3 ] )
1717 const original = await doRequest ( octokit , originalPrNumber , originalRepoName , owner )
1818 if ( original . status === 200 ) {
1919 return original . data
@@ -24,8 +24,8 @@ export async function searchCodePR(octokit: Octokit, prNumber: string, repoName:
2424 return undefined
2525}
2626
27- async function doRequest ( octokit : Octokit , prNumber : string , repoName : string , owner : string ) : Promise < pullRequest > {
28- const request = ` GET /repos/$ {owner } /${ repoName } /pulls/${ prNumber } `
27+ async function doRequest ( octokit : Octokit , prNumber : number , repoName : string , owner : string ) : Promise < pullRequest > {
28+ const request = " GET /repos/{owner}/{repo }/pulls/{pull_number}"
2929
3030 try {
3131 const { data : res } = await octokit . request ( request , {
0 commit comments