github

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReleaseService

type ReleaseService struct {
	// contains filtered or unexported fields
}

ReleaseService deals with git Releases

func NewReleaseService

func NewReleaseService(owner string, repository string, token string) ReleaseService

NewReleaseService creates a new instance of ReleaseService

func (ReleaseService) CreateNext

func (r ReleaseService) CreateNext(version Version, targetCommitish string) (Tag, error)

CreateNext release from the given version and the last semver tag at target commitish

type SemverLabelService

type SemverLabelService struct {
	// contains filtered or unexported fields
}

SemverLabelService deals with pull requests to manage semver labels

func NewSemverLabelService

func NewSemverLabelService(owner string, repository string, token string) SemverLabelService

NewSemverLabelService creates a new instance of SemverLabelService

func (SemverLabelService) CreateList

func (s SemverLabelService) CreateList() error

CreateList populates a repository with all labels needed to version pull requests

func (SemverLabelService) GetFromCommit

func (s SemverLabelService) GetFromCommit(commitSha string) (Version, error)

GetFromCommit find out version label attached to a commit, if the commit doesn't exist or multiple pull requests exist for this commit, it returns an error, if there is more than one this function returns an error, if the commit doesn't belong to a pull request it returns a NORELEASE version

func (SemverLabelService) GetFromPullRequest

func (s SemverLabelService) GetFromPullRequest(pullRequestNumber int) (Version, error)

GetFromPullRequest find out semver version label attached to a pull request, if there is none or more than one this function returns an error

type Tag

type Tag struct {
	LeadingV      bool
	Major         int
	Minor         int
	Patch         int
	PreRelease    string
	BuildMetadata string
}

Tag represents a semver tag

func NewTagFromString

func NewTagFromString(tag string) (Tag, error)

NewTagFromString creates a Tag instance from a tag string representation

func (Tag) String

func (t Tag) String() string

String converts a Tag to its string representation

type Version

type Version int

Version represents a semver version NORELEASE => no version PATCH => 0.0.1 MINOR => 0.1.0 MAJOR => 1.0.0

const (
	// UNVALIDVERSION is default when no semver version exists
	UNVALIDVERSION Version = iota
	// NORELEASE don't create any release
	NORELEASE
	// PATCH represents for instance 0.0.1
	PATCH
	// MINOR represents for instance 0.1.0
	MINOR
	// MAJOR represents for instance 1.0.0
	MAJOR
)

func (Version) String

func (i Version) String() string

Jump to

Keyboard shortcuts

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