Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeCommit ¶
MakeCommit adds the changed files and create a new Git commit.
func ReleaseBranchVersion ¶
ReleaseBranchVersion returns a formatted release branch for a given version.
func ReleaseVersion ¶
ReleaseVersion returns a formatted release tag for a given version.
Types ¶
type Info ¶
type Info struct {
Org string
Repo string
Head string // PR head branch
Base string // PR base branch
UserID string // Github User ID of PR creator
UserName string // User display name for Git commit
Email string // User email address for Git commit
}
Info saves information that can be used to interact with GitHub.
func (*Info) GetHeadRef ¶
GetHeadRef returns the HeadRef with the given Git Info. HeadRef is in the form of "user:head", i.e. "github_user:branch_foo"
type RefType ¶
type RefType int
type Repo ¶
type Repo struct {
Ref string
DefaultBranch string
Tags []string
Branches []string
Submodule string
URL string
}
Repo is a simplified git remote, containing only the list of tags, default branch, branches, URL and submodule information.
func (*Repo) BestRefFor ¶
func (r *Repo) BestRefFor(release, moduleRelease semver.Version, ruleset RulesetType) (string, RefType)
BestRefFor Returns module@ref, isRelease based on the provided ruleset for this release.
type RulesetType ¶
type RulesetType int
RulesetType defines the rules to use for calculating repo.BestRefFor.
const ( // AnyRule - release tag, release branch, or default branch AnyRule RulesetType = iota // ReleaseOrReleaseBranchRule - only release tag or release branch ReleaseOrReleaseBranchRule // ReleaseRule - only release tag ReleaseRule // ReleaseBranchRule - only release branch ReleaseBranchRule // InvalidRule - unable to parse InvalidRule )
func Ruleset ¶
func Ruleset(rule string) RulesetType
Ruleset converts a rule string into a RulesetType.
func (RulesetType) String ¶
func (rt RulesetType) String() string
String returns the string represented by the Ruleset.