repo

package
v0.0.0-...-7391911 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package repo abstracts Git/GitHub

Index

Constants

View Source
const RemoteName = "origin"

Variables

View Source
var DefaultGitIdentity = GitIdentity{
	Name:  "actions-update-go",
	Email: "noreply@github.com",
}

Functions

func ExtractSignedUpdateGroup

func ExtractSignedUpdateGroup(s string) *updater.SignedUpdateGroup

func NewGitHubClient

func NewGitHubClient(token string) *github.Client

Types

type GitHubPullRequestContent

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

func NewGitHubPullRequestContent

func NewGitHubPullRequestContent(gh *github.Client, key []byte) *GitHubPullRequestContent

func (*GitHubPullRequestContent) Generate

func (d *GitHubPullRequestContent) Generate(ctx context.Context, updates updater.UpdateGroup) (title, body string, err error)

func (*GitHubPullRequestContent) ParseBody

type GitHubRepo

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

GitHubRepo wraps GitRepo to create a GitHub PR for the pushed branch.

func NewGitHubRepo

func NewGitHubRepo(repo *GitRepo, hmacKey []byte, repoNameOwner, token string) (*GitHubRepo, error)

func (*GitHubRepo) Branch

func (g *GitHubRepo) Branch() string

func (*GitHubRepo) ExistingUpdates

func (g *GitHubRepo) ExistingUpdates(ctx context.Context, baseBranch string) (updater.ExistingUpdates, error)

func (*GitHubRepo) Fetch

func (g *GitHubRepo) Fetch(ctx context.Context, branch string) error

func (*GitHubRepo) NewBranch

func (g *GitHubRepo) NewBranch(base, branch string) error

func (*GitHubRepo) Push

func (g *GitHubRepo) Push(ctx context.Context, updates updater.UpdateGroup) error

Push follows the git push with opening a pull request

func (*GitHubRepo) Root

func (g *GitHubRepo) Root() string

func (*GitHubRepo) SetBranch

func (g *GitHubRepo) SetBranch(branch string) error

type GitIdentity

type GitIdentity struct {
	Name  string
	Email string
}

GitIdentity performs commits.

type GitRepo

type GitRepo struct {
	NoPush bool
	// contains filtered or unexported fields
}

GitRepo is a Repo that synchronizes access to a single git working tree.

func NewGitRepo

func NewGitRepo(repo *git.Repository) (*GitRepo, error)

NewGitRepo creates GitRepo.

func (*GitRepo) Branch

func (t *GitRepo) Branch() string

func (*GitRepo) ExistingUpdates

func (t *GitRepo) ExistingUpdates(context.Context, string) (updater.ExistingUpdates, error)

func (*GitRepo) Fetch

func (t *GitRepo) Fetch(ctx context.Context, branch string) error

func (*GitRepo) NewBranch

func (t *GitRepo) NewBranch(base, branch string) error

func (*GitRepo) Push

func (t *GitRepo) Push(ctx context.Context, updates updater.UpdateGroup) error

func (*GitRepo) Root

func (t *GitRepo) Root() string

func (*GitRepo) SetBranch

func (t *GitRepo) SetBranch(branch string) error

type PullRequestContent

type PullRequestContent interface {
	Generate(context.Context, updater.UpdateGroup) (title, body string, err error)
}

Jump to

Keyboard shortcuts

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