gh

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ReferenceTagPrefix = "refs/tags/"

ReferenceTagPrefix References that have this prefix are tags

Variables

View Source
var (
	// GitHubToken stores the token to be used to authenticate with GitHub
	GitHubToken string
)

Functions

func Client

func Client() *github.Client

Client get or create the GitHub client

func CreateReference

func CreateReference(gitHubSlug string, reference string, sha string) error

CreateReference creates a reference in GitHub. References should be of the format: refs/type/name, e.g.: refs/tag/v1.2.0

func CreateRelease

func CreateRelease(gitHubSlug, body, tagName, sha string) (*github.RepositoryRelease, error)

CreateRelease creates a release for the repository as specified

func ListTags

func ListTags(gitHubSlug string) ([]*github.Reference, error)

ListTags lists all tags for a specified repository

func TagName

func TagName(ref *github.Reference) string

TagName returns the tag name if the reference is a tag, otherwise, returns empty

func ToOwnerRepo

func ToOwnerRepo(gitHubSlug string) (string, string)

ToOwnerRepo transforms a GitHub slug into owner and repo strings "VinnieApps/cicd-toolbox" -> "VinnieApps", "cicd-toolbox"

func UploadAssetsToRelease

func UploadAssetsToRelease(gitHubSlug string, releaseResponse *github.RepositoryRelease, assetsToUpload []string) error

UploadAssetsToRelease uploads the specified assets to the specified release in the specified repository

Types

This section is empty.

Jump to

Keyboard shortcuts

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