push

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPipelineStatus

func GetPipelineStatus(client *gitlab.Client, owner string, name string, opts *gitlab.ListProjectPipelinesOptions) (string, error)

GetPipelineStatus returns status of pipeline, if pipeline is absent, returns unknown string

Types

type Command

type Command struct {
	Path string
	Args []string
}

Command represents a command to run.

type Input

type Input struct {
	// Repo is the git repo
	Repo lib.Repo
	// PlanDir is where the git repo that has been modified lives.
	PlanDir string
	// WorkDir is where the work associated with the Push operation happens
	WorkDir string
	// CommitMessage is the commit message for the PR
	// Its first line is used as the PR title.
	// Subsequent lines are used as the PR body if there is no body file.
	CommitMessage string
	// PRBody is the body of the PR submitted to Github
	PRBody string
	// PRAssignee is the user who will be assigned the PR
	PRAssignee string
	// BranchName is the branch name in Git
	BranchName string
	// Labels
	Labels []string
	// Draft controls whether it should be a draft PR
	Draft bool
}

Input to Push()

type Output

type Output struct {
	Success                   bool
	CommitSHA                 string
	PullRequestURL            string
	PullRequestNumber         int
	PullRequestCombinedStatus string // failure, pending, or success
	PullRequestAssignee       string
	CircleCIBuildURL          string
}

Output from Push()

func GithubPush

func GithubPush(ctx context.Context, input Input, repoLimiter *time.Ticker, pushLimiter *time.Ticker) (Output, error)

Push pushes the commit to Github and opens a pull request

func GitlabPush

func GitlabPush(ctx context.Context, input Input, repoLimiter *time.Ticker, pushLimiter *time.Ticker) (Output, error)

GitlabPush pushes the commit to Gitlab and opens a pull request

func (Output) String

func (o Output) String() string

Jump to

Keyboard shortcuts

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