Skip to content

Commit

Permalink
add missing fields to serverless pr
Browse files Browse the repository at this point in the history
  • Loading branch information
Ikuni17 committed Nov 14, 2024
1 parent 9636803 commit 9e2aacc
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/common/github-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ type Progress<T> =

export type PrItem = Endpoints['GET /search/issues']['response']['data']['items'][number];
export type Label = PrItem['labels'][number];
export type ServerlessPrItem = Pick<PullRequest, 'url' | 'title' | 'number' | 'body' | 'labels'>;
export type ServerlessPrItem = Pick<
PullRequest,
'id' | 'url' | 'title' | 'number' | 'body' | 'labels' | 'author'
>;

interface GitHubServiceConfig {
octokit: Octokit;
Expand Down Expand Up @@ -305,10 +308,14 @@ class GitHubService {
... on Commit {
associatedPullRequests(first: 10) {
nodes {
id
url
title
number
body
author {
login
}
labels(first: 50) {
nodes {
name
Expand Down Expand Up @@ -354,6 +361,16 @@ class GitHubService {
}
});
});

return pullRequests.map((pr) => {
return {
...pr,
// @ts-expect-error sadasd
labels: pr.labels.nodes,
user: pr.author,
html_url: pr.url,
};
});
}
}

Expand Down

0 comments on commit 9e2aacc

Please sign in to comment.