feat: display author of changes in workflow tab (#5780)

This commit is contained in:
pr0grammm
2021-10-18 17:08:38 +05:30
committed by GitHub
parent 9627452de0
commit 3f607e41d9
30 changed files with 288 additions and 233 deletions

View File

@ -72,6 +72,14 @@ type GraphQLPullRequest = {
id: string;
isFork: boolean;
};
user: GraphQLPullsListResponseItemUser;
};
type GraphQLPullsListResponseItemUser = {
avatar_url: string;
login: string;
url: string;
name: string;
};
function transformPullRequest(pr: GraphQLPullRequest) {
@ -272,6 +280,11 @@ export default class GraphQLAPI extends API {
}
}
async getPullRequestAuthor(pullRequest: Octokit.PullsListResponseItem) {
const user = pullRequest.user as unknown as GraphQLPullsListResponseItemUser;
return user?.name || user?.login;
}
async getPullRequests(
head: string | undefined,
state: PullRequestState,