Documentation
¶
Index ¶
- Constants
- func GenCommentContent(commentPrefix string, delta cover.DeltaCovList) string
- type PrComment
- func (c *PrComment) CreateGithubComment(commentPrefix string, diffCovList cover.DeltaCovList) (err error)
- func (c *PrComment) EraseHistoryComment(commentPrefix string) error
- func (c *PrComment) GetPrChangedFiles() (files []string, err error)
- func (c *PrComment) PostComment(content, commentPrefix string) error
Constants ¶
View Source
const CommentsPrefix = "The following is the coverage report on the affected files."
Variables ¶
This section is empty.
Functions ¶
func GenCommentContent ¶
func GenCommentContent(commentPrefix string, delta cover.DeltaCovList) string
generate github comment content based on diff coverage and commentFlag
Types ¶
type PrComment ¶
type PrComment struct {
RobotUserName string
RepoOwner string
RepoName string
CommentFlag string
PrNumber int
Ctx context.Context
GithubClient *github.Client
// contains filtered or unexported fields
}
func NewPrClient ¶
func NewPrClient(githubTokenPath, repoOwner, repoName, prNumStr, botUserName, commentFlag string) *PrComment
NewPrClient creates an Client which be able to comment on Github Pull Request
func (*PrComment) CreateGithubComment ¶
func (c *PrComment) CreateGithubComment(commentPrefix string, diffCovList cover.DeltaCovList) (err error)
post github comment of diff coverage
func (*PrComment) EraseHistoryComment ¶
erase history similar comment before post again
func (*PrComment) GetPrChangedFiles ¶
GetPrChangedFiles get github pull request changes file list
func (*PrComment) PostComment ¶
Click to show internal directories.
Click to hide internal directories.