github

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxRedirects          = 10
	ActionNoChangesMarker = "# No changes"
)

Variables

View Source
var ErrInvalidFormat = errors.New("invalid format")
View Source
var ErrNotFound = errors.New("not found")

Functions

func IsNotFound

func IsNotFound(err error) bool

Types

type Config

type Config struct {
	Token string
}

type Github

type Github struct {
	*github.Client
	Graph *githubv4.Client
}

func New

func New(config Config) *Github

type Repository

type Repository struct {
	*Github
	Name         string
	Organization string
	Branch       string
}

func (*Repository) AddCollaborator

func (r *Repository) AddCollaborator(ctx context.Context, slug string, permission string) error

func (*Repository) Check

func (r *Repository) Check(ctx context.Context) error

func (*Repository) CheckBranch

func (r *Repository) CheckBranch(ctx context.Context) error

func (*Repository) CheckOrganization

func (r *Repository) CheckOrganization(ctx context.Context) error

func (*Repository) CheckRepository

func (r *Repository) CheckRepository(ctx context.Context) error

func (*Repository) CreateBranch

func (r *Repository) CreateBranch(ctx context.Context, mainbranch string) error

func (*Repository) CreateDirectory

func (r *Repository) CreateDirectory(ctx context.Context, content map[string]string, message string) error

func (*Repository) CreateFile

func (r *Repository) CreateFile(ctx context.Context, content []byte, path string) error

func (*Repository) CreatePrivateRepo

func (r *Repository) CreatePrivateRepo(ctx context.Context, description string, template string) error

func (*Repository) CreatePullRequest

func (r *Repository) CreatePullRequest(ctx context.Context, title string, base string) error

func (*Repository) GetDirectory

func (r *Repository) GetDirectory(ctx context.Context, path string) (map[string]string, error)

func (*Repository) GetFile

func (r *Repository) GetFile(ctx context.Context, path string) (string, error)

func (*Repository) GetFileSHA

func (r *Repository) GetFileSHA(ctx context.Context, path string) (string, error)

func (*Repository) GetStringFromFile

func (r *Repository) GetStringFromFile(file *github.RepositoryContent) (string, error)

func (*Repository) SetupBranchProtection

func (r *Repository) SetupBranchProtection(ctx context.Context, branch string) error

Jump to

Keyboard shortcuts

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