Skip to content

Commit

Permalink
refactor: move code
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Jan 24, 2021
1 parent 0147818 commit 22af241
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
15 changes: 15 additions & 0 deletions pkg/api/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,18 @@ func listHiddenComments( //nolint:funlen
}
return nodeIDs, nil
}

func isExcludedComment(cmt comment.IssueComment, login string) bool {
if !cmt.ViewerCanMinimize {
return true
}
if cmt.IsMinimized {
return true
}
// GitHub Actions's GITHUB_TOKEN secret doesn't have a permission to get an authenticated user.
// So if `login` is empty, we give up filtering comments by login.
if login != "" && cmt.Author.Login != login {
return true
}
return false
}
15 changes: 0 additions & 15 deletions pkg/api/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,6 @@ type Platform interface {
CI() string
}

func isExcludedComment(cmt comment.IssueComment, login string) bool {
if !cmt.ViewerCanMinimize {
return true
}
if cmt.IsMinimized {
return true
}
// GitHub Actions's GITHUB_TOKEN secret doesn't have a permission to get an authenticated user.
// So if `login` is empty, we give up filtering comments by login.
if login != "" && cmt.Author.Login != login {
return true
}
return false
}

func (ctrl *PostController) getCommentParams(opts option.PostOptions) (comment.Comment, error) { //nolint:funlen
cmt := comment.Comment{}
if ctrl.Platform != nil {
Expand Down

0 comments on commit 22af241

Please sign in to comment.