templates

package
v2.0.14 Latest Latest
Warning

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

Go to latest
Published: May 24, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequireCommitOnMain

func RequireCommitOnMain(commit string)

Types

type GitLog

type GitLog struct {
	// Abbreviated commit hash.
	Commit string
	// Commit subject.
	Subject string
	// Associated branch name. Branch might not exist.
	Branch string
}

Returned by some of the Get*Commit functions.

func GetAllCommits

func GetAllCommits() []GitLog

Returns all the commits on the current branch. For use by tests.

func GetBranchInfo

func GetBranchInfo(commitIndicator string, indicatorType IndicatorType) GitLog

Returns BranchInfo for commitIndicator and indicatorType.

func GetNewCommits

func GetNewCommits(to string) []GitLog

type IndicatorType

type IndicatorType string

Enum for what commitIndicator represents.

const (
	// commitIndicator is a commit hash.
	IndicatorTypeCommit IndicatorType = "commit"
	// commitIndicator is a PR number.
	IndicatorTypePr IndicatorType = "pr"
	// commitIndicator is a list index from log (1 based).
	IndicatorTypeList IndicatorType = "list"
	// Guess based on length of commitIndicator and whether it is all numeric.
	IndicatorTypeGuess IndicatorType = "guess"
)

func (IndicatorType) IsValid

func (indicator IndicatorType) IsValid() bool

Returns weather the indicator type is of a known type.

type PullRequestText

type PullRequestText struct {
	Title       string
	Description string
}

func GetPullRequestText

func GetPullRequestText(commitHash string, featureFlag string) PullRequestText

Jump to

Keyboard shortcuts

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