github

package
v0.3.20 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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) FileExists added in v0.3.0

func (r *Repository) FileExists(ctx context.Context, path string) (bool, 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) PullRequestExists added in v0.3.5

func (r *Repository) PullRequestExists(ctx context.Context, title string) (bool, 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