Documentation ¶
Index ¶
Constants ¶
View Source
const ( WorkspacePathEnvVar = "GITHUB_WORKSPACE" NightfallAPIKeyEnvVar = "NIGHTFALL_API_KEY" CircleRepoNameEnvVar = "CIRCLE_PROJECT_REPONAME" CircleOwnerNameEnvVar = "CIRCLE_PROJECT_USERNAME" CircleCurrentCommitShaEnvVar = "CIRCLE_SHA1" CircleBeforeCommitEnvVar = "EVENT_BEFORE" CirclePullRequestUrlEnvVar = "CIRCLE_PULL_REQUEST" CircleBranchEnvVar = "CIRCLE_BRANCH" // branch that triggered the workflow GithubBaseBranchEnvVar = "GITHUB_BASE_BRANCH" // optional user input variable if base branch is not master DefaultBaseBranchName = "master" // diff against base branch if workflow triggered by PR // right side is reserved for additions and unchanged lines // https://developer.github.com/v3/pulls/comments/#create-a-review-comment-for-a-pull-request GithubCommentRightSide = "RIGHT" )
Variables ¶
This section is empty.
Functions ¶
func NewCircleCiService ¶
func NewCircleCiService() diffreviewer.DiffReviewer
NewCircleCiService creates a new CircleCi service
func NewCircleCiServiceWithGithubComments ¶ added in v0.0.5
func NewCircleCiServiceWithGithubComments(token string) diffreviewer.DiffReviewer
NewCircleCiServiceWithGithubComments creates a new CircleCi service with an authenticated Github client
Types ¶
type Service ¶
type Service struct { GithubClient githubintf.GithubClient Logger logger.Logger GitDiff gitdiffintf.GitDiff PrDetails prDetails }
Service contains the github client that makes Github api calls
func (*Service) GetDiff ¶
func (s *Service) GetDiff() ([]*diffreviewer.FileDiff, error)
GetDiff retrieves the file diff from the requested pull request
func (*Service) LoadConfig ¶
func (s *Service) LoadConfig(nightfallConfigFileName string) (*nightfallconfig.Config, error)
LoadConfig gets all config values from files or environment and creates a config
func (*Service) WriteComments ¶
func (s *Service) WriteComments(comments []*diffreviewer.Comment) error
WriteComments posts the findings as annotations to the github check
Click to show internal directories.
Click to hide internal directories.