Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 094feaa

Browse files
committed
feat: extend github api
Add api call to fetch pull request comments
1 parent fa12bff commit 094feaa

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/github.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ export interface GitHub {
2727

2828
issues(owner: string, repo: string, parameters?: IssuesParameters): Promise<GitHubResponse<Issue[]>>;
2929

30+
getPullRequestComments(owner: string, repo: string, number: number): Promise<GitHubResponse<PullRequestComment[]>>;
31+
3032
}
3133

3234
export interface GitHubResponse<T> {
@@ -35,6 +37,13 @@ export interface GitHubResponse<T> {
3537
body: T;
3638
}
3739

40+
export interface PullRequestComment {
41+
diff_hunk: string;
42+
path: string;
43+
position: number;
44+
body: string;
45+
}
46+
3847
export interface Issue {
3948
html_url: string;
4049
number: number;
@@ -210,7 +219,7 @@ namespace impl {
210219

211220
@Headers('Accept: application/vnd.github.polaris-preview')
212221
@Get('/repos/:owner/:repo')
213-
public getRepository(_owner: string, _repo: string): any {/* */}
222+
public getRepository(): any {/* */}
214223

215224
@Get('/repos/:owner/:repo/pulls/:number')
216225
public getPullRequest(): any {/* */}
@@ -245,5 +254,8 @@ namespace impl {
245254
@Get('/repos/:owner/:repo/issues', true)
246255
public issues(): any {/* */}
247256

257+
@Get('/repos/:owner/:repo/pulls/:number/comments')
258+
public getPullRequestComments(): any {/* */}
259+
248260
}
249261
}

0 commit comments

Comments
 (0)