gh

package
v0.47.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultGithubServerURL = "https://github.com"

Variables

This section is empty.

Functions

func PushUsingLocalGit added in v0.9.0

func PushUsingLocalGit(ctx context.Context, gitRoot string, addPaths []string, message string) (int, error)

Types

type ArtifactFile added in v0.35.0

type ArtifactFile struct {
	Name      string
	Content   []byte
	CreatedAt time.Time
}

type Gh

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

func New

func New() (*Gh, error)

func (*Gh) Client added in v0.29.0

func (g *Gh) Client() *github.Client

func (*Gh) DetectCurrentBranch added in v0.29.0

func (g *Gh) DetectCurrentBranch(ctx context.Context) (string, error)

func (*Gh) DetectCurrentJobID

func (g *Gh) DetectCurrentJobID(ctx context.Context, owner, repo string) (int64, error)

func (*Gh) DetectCurrentPullRequestNumber added in v0.11.0

func (g *Gh) DetectCurrentPullRequestNumber(ctx context.Context, owner, repo string) (int, error)

func (*Gh) GetChangedFiles added in v0.43.1

func (g *Gh) GetChangedFiles(ctx context.Context, owner, repo string) ([]*PullRequestFile, error)

func (*Gh) GetDefaultBranch added in v0.14.0

func (g *Gh) GetDefaultBranch(ctx context.Context, owner, repo string) (string, error)

func (*Gh) GetLatestArtifact added in v0.35.0

func (g *Gh) GetLatestArtifact(ctx context.Context, owner, repo, name, fp string) (*ArtifactFile, error)

func (*Gh) GetPullRequest added in v0.42.0

func (g *Gh) GetPullRequest(ctx context.Context, owner, repo string, number int) (*PullRequest, error)

func (*Gh) GetPullRequestFiles added in v0.19.0

func (g *Gh) GetPullRequestFiles(ctx context.Context, owner, repo string, number int) ([]*PullRequestFile, error)

func (*Gh) GetRawRootURL

func (g *Gh) GetRawRootURL(ctx context.Context, owner, repo string) (string, error)

func (*Gh) GetStepByTime added in v0.31.0

func (g *Gh) GetStepByTime(ctx context.Context, owner, repo string, jobID int64, t time.Time) (Step, error)

func (*Gh) GetStepExecutionTimeByTime

func (g *Gh) GetStepExecutionTimeByTime(ctx context.Context, owner, repo string, jobID int64, t time.Time) (time.Duration, error)

func (*Gh) GetStepsByName added in v0.10.0

func (g *Gh) GetStepsByName(ctx context.Context, owner, repo string, name string) ([]Step, error)

func (*Gh) PushContent

func (g *Gh) PushContent(ctx context.Context, owner, repo, branch, content, cp, message string) error

func (*Gh) PutArtifact added in v0.35.0

func (g *Gh) PutArtifact(ctx context.Context, name, fp string, content []byte) error

func (*Gh) PutComment added in v0.11.0

func (g *Gh) PutComment(ctx context.Context, owner, repo string, n int, comment, key string) error

func (*Gh) PutCommentWithDeletion added in v0.34.0

func (g *Gh) PutCommentWithDeletion(ctx context.Context, owner, repo string, n int, comment, key string) error

func (*Gh) ReplaceInsertToBody added in v0.43.0

func (g *Gh) ReplaceInsertToBody(ctx context.Context, owner, repo string, number int, content, key string) error

func (*Gh) SetClient added in v0.29.0

func (g *Gh) SetClient(client *github.Client)

type GitHubEvent added in v0.13.0

type GitHubEvent struct {
	Name    string
	Number  int
	State   string
	Payload interface{}
}

func DecodeGitHubEvent added in v0.13.0

func DecodeGitHubEvent() (*GitHubEvent, error)

type PullRequest added in v0.42.0

type PullRequest struct {
	Number  int
	IsDraft bool
	Labels  []string
}

type PullRequestFile added in v0.19.0

type PullRequestFile struct {
	Filename string
	BlobURL  string
}

type Repository added in v0.28.0

type Repository struct {
	Owner string
	Repo  string
	Path  string
}

func Parse added in v0.28.0

func Parse(raw string) (*Repository, error)

func (*Repository) Reponame added in v0.28.0

func (r *Repository) Reponame() string

type Step added in v0.10.0

type Step struct {
	Name        string
	StartedAt   time.Time
	CompletedAt time.Time
}

Jump to

Keyboard shortcuts

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