Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterBranches ¶
FilterBranches which should be deleted, for the the moment there is semver.MajorMinor used e.g. we have the following branches /release/v1.0.0 /release/v1.1.0 /release/v1.1.1 the function would filter out /release/v1.1.0, as /release/v1.1.1 is newer than v1.1.0.
Types ¶
type GitInterface ¶
type GitInterface interface { List(*git.ListOptions) ([]*plumbing.Reference, error) Config() *config.RemoteConfig Push(*git.PushOptions) error }
GitInterface all of the functions we use from the third party client to be able to mock them in the tests.
type RemoteBranch ¶
type RemoteBranch struct {
// contains filtered or unexported fields
}
RemoteBranch to implement the interface
func (*RemoteBranch) CleanBranches ¶
func (m *RemoteBranch) CleanBranches(branchesToDelete []string, exclusionList []string, dryRun bool) (deletedBranches []string)
CleanBranches deletes branches from the remote repo which are included in the branchesToDelete slice, it excludes branches from the exclusionList. You can simulate the deletion, with dryRun
func (*RemoteBranch) GetRemoteBranches ¶
func (m *RemoteBranch) GetRemoteBranches(repoURL string, branchFilter string, latest bool) []string
GetRemoteBranches get remote branches from GitHub using the repoURL and the branchFilter