git

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Username string
	Token    string
	Email    string
}

Config represents the inputs needed to set up a Repo.

type Repo

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

Repo represents a git repository, which receives convenience methods for retrieving code.

func New

func New(ctx context.Context, c Config, logger *log.Entry) *Repo

New creates a Repo struct using a Config struct.

func (*Repo) CloneWithCheckout

func (r *Repo) CloneWithCheckout(tmpDir string, payload hooks.PushPayload) error

CloneWithCheckout uses a github Push Event payload to clone down a repository and immediately checkout HEAD on the branch that caused that Push Event.

func (*Repo) CreateAuthenticatedURL

func (r *Repo) CreateAuthenticatedURL(cloneURL string) (string, error)

CreateAuthenticatedURL adds the username and password from the instantiation of the Repo to use https authentication on all calls to the origin.

func (*Repo) CreateRelease

func (r *Repo) CreateRelease(ctx context.Context, owner, repo string, rel *github.RepositoryRelease) (*github.RepositoryRelease, error)

CreateRelease sends a request to github using the passed body and payload structs to create a new release on a repo

func (Repo) CreateTag

func (r Repo) CreateTag(dir, version, msg string) error

CreateTag makes an annotated git tag on a repo.

func (Repo) PushTags

func (r Repo) PushTags(dir string) error

PushTags pushes a repo with no other changes but tags up to the origin.

func (*Repo) SetGitConfig added in v0.1.1

func (r *Repo) SetGitConfig() error

SetGitConfig sets the email and name for usage when sending in git commits

func (Repo) UploadReleaseAsset

func (r Repo) UploadReleaseAsset(ctx context.Context, owner, repo string, releaseID int64, opts *github.UploadOptions, file *os.File) error

UploadReleaseAsset uploads a file to a Github release

Jump to

Keyboard shortcuts

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