github

package
v1.5.10 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValidationContext = "peacock-validation"
	ReleaseContext    = "peacock-release"
)

Variables

View Source
var (
	RepoStatus = map[string]*github.RepoStatus{
		ValidationContext: {
			State:       nil,
			Description: utils.NewPtr("Validates the PR body against the feathers"),
			Context:     utils.NewPtr(ValidationContext),
		},
		ReleaseContext: {
			State:       nil,
			Description: utils.NewPtr("Sends the messages to the Teams outlined in the PR body"),
			Context:     utils.NewPtr(ReleaseContext),
		},
	}
)

RepoStatus Base repository statuses to use for creating a commit status

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(user, token string) *Client

func (*Client) CommentError added in v1.0.0

func (c *Client) CommentError(ctx context.Context, owner, repoName string, prNumber int, prOwner string, err error) error

func (*Client) CommentOnPR

func (c *Client) CommentOnPR(ctx context.Context, owner, repoName string, prNumber int, body string) error

func (*Client) CreatePeacockCommitStatus added in v1.0.0

func (c *Client) CreatePeacockCommitStatus(ctx context.Context, owner, repoName, ref string, state domain.State, statusContext string) error

func (*Client) DeleteUsersComments added in v1.0.0

func (c *Client) DeleteUsersComments(ctx context.Context, owner, repoName string, prNumber int) error

func (*Client) GetFileFromBranch added in v1.0.0

func (c *Client) GetFileFromBranch(ctx context.Context, owner, repoName, branch, path string) ([]byte, error)

func (*Client) GetLatestCommitSHAInBranch added in v1.0.0

func (c *Client) GetLatestCommitSHAInBranch(ctx context.Context, owner, repoName, branch string) (string, error)

func (*Client) GetPRComments added in v0.13.0

func (c *Client) GetPRComments(ctx context.Context, owner, repoName string, prNumber int) ([]*github.IssueComment, error)

func (*Client) GetPRCommentsByUser added in v1.0.0

func (c *Client) GetPRCommentsByUser(ctx context.Context, owner, repoName string, prNumber int) ([]*github.IssueComment, error)

func (*Client) GetPullRequestBodyFromCommit

func (c *Client) GetPullRequestBodyFromCommit(ctx context.Context, owner, repoName, sha string) (*string, error)

func (*Client) GetPullRequestBodyFromPRNumber

func (c *Client) GetPullRequestBodyFromPRNumber(ctx context.Context, owner, repoName string, prNumber int) (*string, error)

func (*Client) HandleError added in v1.0.0

func (c *Client) HandleError(ctx context.Context, statusContext, owner, repoName string, prNumber int, headSHA, prOwner string, err error) error

Jump to

Keyboard shortcuts

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