ghapputil

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExcludePREventByAction

func ExcludePREventByAction(prEvent *github.PullRequestEvent) bool

func GetGitHubAppEnv

func GetGitHubAppEnv(appID, instID int64) []*codebuild.EnvironmentVariable

func GetLabelNames

func GetLabelNames(labels []*github.Label) []string

func GetPRFiles

func GetPRFiles(ctx context.Context, client *github.Client, owner, repo string, prNumber, fileSize int) ([]*github.CommitFile, error)

func GetSourceVersion

func GetSourceVersion(prEvent *github.PullRequestEvent, isSHA bool) string

func NewGitHubClient

func NewGitHubClient(appID int64, event *github.PullRequestEvent, keyFile []byte) (*github.Client, error)

func ParseWebHook

func ParseWebHook(event, body string) (interface{}, error)

func ReadSecretFromSecretsManager

func ReadSecretFromSecretsManager(ctx context.Context, svc SecretsManager, input *secretsmanager.GetSecretValueInput, secret interface{}) error

func ValidateSignature

func ValidateSignature(event *Event, webhookSecret []byte) error

Types

type Builder added in v0.2.1

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

func NewBuilder added in v0.2.1

func NewBuilder(sess *session.Session) *Builder

func (*Builder) Start added in v0.2.1

func (builder *Builder) Start(ctx aws.Context, input *StartBuildInput) (*codebuild.StartBuildOutput, error)

type CodeBuild

type CodeBuild interface {
	StartBuildWithContext(ctx aws.Context, input *codebuild.StartBuildInput, opts ...request.Option) (*codebuild.StartBuildOutput, error)
}

type Event

type Event struct {
	Body    string  `json:"body"`
	Headers Headers `json:"headers"`
}

type Headers

type Headers struct {
	Event     string `json:"x-github-event"`
	Delivery  string `json:"x-github-delivery"`
	Signature string `json:"x-hub-signature-256"`
}

type Response

type Response struct {
	StatusCode int         `json:"statusCode"`
	Body       interface{} `json:"body"`
}

func NewResponse

func NewResponse(code int, message string) *Response

type ResponseBody

type ResponseBody struct {
	Message string `json:"message"`
}

type Secret

type Secret struct {
	WebhookSecret       string `json:"webhook_secret"`
	GitHubAppPrivateKey string `json:"github_app_private_key"`
}

type SecretsManager

type SecretsManager interface {
	GetSecretValueWithContext(ctx aws.Context, input *secretsmanager.GetSecretValueInput, opts ...request.Option) (*secretsmanager.GetSecretValueOutput, error)
}

type StartBuildError added in v0.2.1

type StartBuildError struct {
	Input  *StartBuildInput
	Output *codebuild.StartBuildOutput
	Error  error
}

func StartBuild added in v0.2.1

func StartBuild(ctx context.Context, builder *Builder, inputs []*StartBuildInput) []*StartBuildError

type StartBuildInput added in v0.2.1

type StartBuildInput struct {
	Input         *codebuild.StartBuildInput
	Region        string
	AssumeRoleARN string
	Options       []request.Option
}

Jump to

Keyboard shortcuts

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