github

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBaseURL       = "https://api.github.com/"
	DefaultUploadBaseURL = "https://uploads.github.com/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHubConfiguration

type GitHubConfiguration struct {
	Org           string
	Repo          string
	CommitSha     string
	EnterpriseUrl string
	PrNumber      int
	IsEnterprise  bool
	// contains filtered or unexported fields
}

func New

func New(context context.Context, log *zap.Logger, org, repo, commitSha, accessToken string, prNumber int, enterpriseUrl string, isEnterprise bool) *GitHubConfiguration

func (*GitHubConfiguration) CleanExistingCommentsOnAllPullRequestCommits

func (c *GitHubConfiguration) CleanExistingCommentsOnAllPullRequestCommits(commentHeading string) error

func (*GitHubConfiguration) CleanExistingCommentsOnCommit

func (c *GitHubConfiguration) CleanExistingCommentsOnCommit(commentHeading string) error

func (*GitHubConfiguration) CleanExistingCommentsOnPullRequest

func (c *GitHubConfiguration) CleanExistingCommentsOnPullRequest(commentHeading string) error

func (*GitHubConfiguration) CreateDeployment

func (c *GitHubConfiguration) CreateDeployment(environment string, envIsProd bool, autoMerge bool, description string, requiredContexts []string) (*github.Deployment, error)

func (*GitHubConfiguration) CreateDeploymentAndStatus

func (c *GitHubConfiguration) CreateDeploymentAndStatus(environment string, envIsProd bool, autoMerge bool, description string, requiredContexts []string, state string, autoInactive bool, logsUrl *string, environmentUrl *string) (*github.Deployment, *github.DeploymentStatus, error)

func (*GitHubConfiguration) CreateDeploymentStatus

func (c *GitHubConfiguration) CreateDeploymentStatus(deploymentId int64, environment string, state string, autoInactive bool, description string, logsUrl *string, environmentUrl *string) (*github.DeploymentStatus, error)

func (*GitHubConfiguration) GetCommitCheckStatus

func (c *GitHubConfiguration) GetCommitCheckStatus(state string, context string, targetUrl string, description string) ([]*github.RepoStatus, error)

func (*GitHubConfiguration) NewClient

func (c *GitHubConfiguration) NewClient() (*github.Client, error)

func (*GitHubConfiguration) WriteCommitCheckStatus

func (c *GitHubConfiguration) WriteCommitCheckStatus(state string, context string, targetUrl string, description string) (*github.RepoStatus, error)

func (*GitHubConfiguration) WriteCommitCheckStatusIfFailedDoesNotExist

func (c *GitHubConfiguration) WriteCommitCheckStatusIfFailedDoesNotExist(state string, context string, targetUrl string, description string) (*github.RepoStatus, error)

func (*GitHubConfiguration) WriteCommitComment

func (c *GitHubConfiguration) WriteCommitComment(body string, commentHeading string, removeDuplicateCommitComment bool) (*github.RepositoryComment, error)

func (*GitHubConfiguration) WritePullRequestComment

func (c *GitHubConfiguration) WritePullRequestComment(body string) (*github.IssueComment, error)

type Hook

type Hook struct {
	Signature string
	Payload   []byte
}

func NewHookRequest

func NewHookRequest(req *http.Request) (hook *Hook, err error)

func Parse

func Parse(secret []byte, req *http.Request) (hook *Hook, err error)

func (*Hook) Extract

func (h *Hook) Extract(dst interface{}) error

func (*Hook) SignedBy

func (h *Hook) SignedBy(secret []byte) bool

Jump to

Keyboard shortcuts

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