pkg

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterBranches

func FilterBranches(branches []string) []string

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 New

New constructor

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

Jump to

Keyboard shortcuts

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