actions

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePullRequest

func CreatePullRequest(ctx context.Context, repo *git.Repo, client *gh.Client, opts CreatePullRequestOpts) (*gh.PullRequest, error)

CreatePullRequest creates a pull request on GitHub for the current branch, if one doesn't already exist.

func Push

func Push(repo *git.Repo, opts PushOpts) error

Push pushes the current branch to the Git origin. It does not check out the given branch.

Types

type CreatePullRequestOpts

type CreatePullRequestOpts struct {
	Title string
	Body  string

	// If true, create the pull request as a GitHub draft PR.
	Draft bool
	// If true, do not push the branch to GitHub
	NoPush bool
	// If true, create a PR even if we think one already exists
	Force bool
}

type ForceOpt

type ForceOpt int
const (
	NoForce ForceOpt = iota
	// ForceWithLease indicates that the push should use the --force-with-lease
	// option which instructs Git that it should only force push to the remote
	// branch if its current HEAD matches what we think it should be.
	ForceWithLease ForceOpt = iota
	ForcePush      ForceOpt = iota
)

type PushOpts

type PushOpts struct {
	Force ForceOpt
}

type ReparentResult added in v0.0.4

type ReparentResult struct {
	Success bool
	Hint    string
}

func Reparent added in v0.0.4

func Reparent(repo *git.Repo, branch string, newParent string) (*ReparentResult, error)

Reparent changes the parent branch of a stacked branch (performing a rebase if necessary).

func ReparentContinue added in v0.0.4

func ReparentContinue(repo *git.Repo, branch string, newParent string) (*ReparentResult, error)

type UpdatePullRequestResult added in v0.0.4

type UpdatePullRequestResult struct {
	// True if the pull request information changed (e.g., a new pull request
	// was found or if the pull request changed state)
	Changed bool
	// The (updated) branch metadata.
	Branch meta.Branch
	// The pull request object that was returned from GitHub
	Pull *gh.PullRequest
}

func UpdatePullRequestState added in v0.0.4

func UpdatePullRequestState(ctx context.Context, repo *git.Repo, client *gh.Client, repoMeta meta.Repository, branchName string) (*UpdatePullRequestResult, error)

UpdatePullRequestState fetches the latest pull request information from GitHub and writes the relevant branch metadata.

Jump to

Keyboard shortcuts

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