Skip to content

Commit

Permalink
Fix a bug where Danger would get all inline comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshinejr committed Apr 2, 2018
1 parent 069a617 commit 697ef32
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions source/platforms/github/GitHubAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,12 @@ export class GitHubAPI {
const repo = this.repoMetadata.repoSlug
const prID = this.repoMetadata.pullRequestID
return await this.getAllOfResource(`repos/${repo}/pulls/${prID}/comments`).then(v => {
return v.filter(Boolean).map((i: any) => {
return { id: i.id, ownedByDanger: i.user.id == userID && i.body.includes(dangerID), body: i.body }
})
return v
.filter(Boolean)
.map((i: any) => {
return { id: i.id, ownedByDanger: i.user.id == userID && i.body.includes(dangerID), body: i.body }
})
.filter((i: any) => i.ownedByDanger)
})
}

Expand Down

0 comments on commit 697ef32

Please sign in to comment.