github

package
v0.17.12 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHub

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

func NewGitHub

func NewGitHub(opts *Options) *GitHub

NewGitHub returns a new GitHub instance.

func (*GitHub) SetImplementation

func (g *GitHub) SetImplementation(i impl)

SetImplementation sets the implementation to handle file operations and GitHub client.

func (*GitHub) UpdateGitHubPage

func (g *GitHub) UpdateGitHubPage() (err error)

UpdateGitHubPage updates a github page with data from the release.

type Options

type Options struct {
	// ReleaseType indicates if we are dealing with an alpha,
	// beta, rc or official
	ReleaseType string

	// AssetFiles is a list of paths of files to be uploaded
	// as assets of this release
	AssetFiles []string

	// Tag is the release the github page will be edited
	Tag string

	// The release can have a name
	Name string

	// Owner GitHub organization which owns the repository
	Owner string

	// Name of the repository where we will publish the
	// release page. The specified tag has to exist there already
	Repo string

	// Run the whole process in non-mocked mode. Which means that it uses
	// production remote locations for storing artifacts and modifying git
	// repositories.
	NoMock bool

	// Create a draft release
	Draft bool

	// If the release exists, we do not overwrite the release page
	// unless specified so.
	UpdateIfReleaseExists bool

	// We can use a custom page template by spcifiying the path. The
	// file is a go template file that renders markdown.
	PageTemplate string

	// File to read the release notes from
	ReleaseNotesFile string

	// We automatizally calculate most values, but more substitutions for
	// the template can be supplied
	Substitutions map[string]string
}

Options data for building the release page.

func (*Options) ParseSubstitutions

func (o *Options) ParseSubstitutions(subs []string) error

ParseSubstitutions gets a slice of strings with the substitutions for the template and parses it as Substitutions in the options.

func (*Options) ReadTemplate

func (o *Options) ReadTemplate(templatePath string) error

ReadTemplate reads a custom template from a file and sets the PageTemplate option with its content.

func (*Options) SetRepository

func (o *Options) SetRepository(repoSlug string) error

SetRepository takes a repository slug in the form org/repo, paeses it and assigns the values to the options.

func (*Options) Validate

func (o *Options) Validate() error

Validate the GitHub page options to ensure they are correct.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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