Skip to content

Commit

Permalink
update return value
Browse files Browse the repository at this point in the history
  • Loading branch information
rgychiu committed Nov 17, 2023
1 parent 6285408 commit 515c7f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pullAuthors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ query($owner:String! $name:String! $number:Int! $cursor:String!){

public async getAuthors(): Promise<Author[]> {
const result = await this.queryForCommitAuthors();
return result.repository.pullRequest.commits.edges
return result.pullRequest.commits.edges
.map(e => this.getUserFromCommit(e.node.commit)) // Get the authors
.filter((author: Author, index: number, self: Author[]) => self.findIndex(a => a.name === author.name) === index) // Only unique authors
.filter((a: Author) => a.id !== 41898282); // And skip accounts with this ID for some reason?
Expand All @@ -69,7 +69,7 @@ query($owner:String! $name:String! $number:Int! $cursor:String!){
if (result.repository.pullRequest.commits.totalCount > 100) {
throw new Error("Commit query has more than 100 commits and GraphQL pagination isn't supported yet! Can't validate all of the authors of this PR.")
}
return result;
return result.repository;
} catch (error) {
throw new Error(`GraphQL query to get commit authors failed: '${error.message}'. Details: ${JSON.stringify(error)} `);
}
Expand Down

0 comments on commit 515c7f4

Please sign in to comment.