github

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2020 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

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

func (c *PrComment) EraseHistoryComment(commentPrefix string) error

erase history similar comment before post again

func (*PrComment) GetPrChangedFiles

func (c *PrComment) GetPrChangedFiles() (files []string, err error)

GetPrChangedFiles get github pull request changes file list

func (*PrComment) PostComment

func (c *PrComment) PostComment(content, commentPrefix string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL