github

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements remote.Provider for GitHub Actions

func NewClient

func NewClient(token, owner, repo string) *Client

NewClient creates a new GitHub client with token authentication

func NewClientFromEnv

func NewClientFromEnv() (*Client, error)

NewClientFromEnv creates a GitHub client using environment variables and git remote

func NewClientWithBaseURL added in v1.2.1

func NewClientWithBaseURL(token, owner, repo, baseURL string) (*Client, error)

NewClientWithBaseURL creates a new GitHub client for GitHub Enterprise with custom base URL

func (*Client) CreatePullRequest

func (c *Client) CreatePullRequest(ctx context.Context, title, body, head, base string, draft bool) (int, string, error)

CreatePullRequest creates a new pull request

func (*Client) DeleteAllArtifacts added in v1.2.1

func (c *Client) DeleteAllArtifacts(ctx context.Context) (deleted int, freedBytes int64, err error)

DeleteAllArtifacts deletes all artifacts in the repository

func (*Client) DeleteArtifact added in v1.2.1

func (c *Client) DeleteArtifact(ctx context.Context, artifactID int64) error

DeleteArtifact deletes a single artifact by ID

func (*Client) DeleteArtifactsBefore added in v1.2.1

func (c *Client) DeleteArtifactsBefore(ctx context.Context, before time.Time) (deleted int, freedBytes int64, err error)

DeleteArtifactsBefore deletes all artifacts created before the given time

func (*Client) DeleteExpiredArtifacts added in v1.2.1

func (c *Client) DeleteExpiredArtifacts(ctx context.Context) (deleted int, freedBytes int64, err error)

DeleteExpiredArtifacts deletes all expired artifacts

func (*Client) GetLatestWorkflow

func (c *Client) GetLatestWorkflow(ctx context.Context, branch string) (*remote.Workflow, error)

GetLatestWorkflow returns the most recent workflow run for a branch

func (*Client) GetPullRequest

func (c *Client) GetPullRequest(ctx context.Context, prNumber int) (*github.PullRequest, error)

GetPullRequest returns a single pull request by number

func (*Client) GetPullRequestByBranch

func (c *Client) GetPullRequestByBranch(ctx context.Context, branch string) (int, string, error)

GetPullRequestByBranch finds a PR for the given head branch

func (*Client) GetPullRequestChecks

func (c *Client) GetPullRequestChecks(ctx context.Context, prNumber int) (*remote.PRChecks, error)

GetPullRequestChecks returns the status of all checks/workflows for a PR

func (*Client) GetPullRequestDetails added in v1.3.0

func (c *Client) GetPullRequestDetails(ctx context.Context, prNumber int) (*remote.PullRequestDetails, error)

GetPullRequestDetails returns comprehensive PR details for TUI display

func (*Client) GetPullRequestReviews

func (c *Client) GetPullRequestReviews(ctx context.Context, prNumber int) ([]*github.PullRequestReview, error)

GetPullRequestReviews returns reviews for a pull request

func (*Client) ListArtifacts added in v1.2.1

func (c *Client) ListArtifacts(ctx context.Context) (*remote.ArtifactStats, error)

ListArtifacts returns all artifacts for the repository with storage statistics

func (*Client) ListPullRequests

func (c *Client) ListPullRequests(ctx context.Context, state string) ([]*github.PullRequest, error)

ListPullRequests lists pull requests with the given state (open, closed, all)

func (*Client) MarkPullRequestReady

func (c *Client) MarkPullRequestReady(ctx context.Context, prNumber int) error

MarkPullRequestReady marks a draft PR as ready for review

func (*Client) MergePullRequest

func (c *Client) MergePullRequest(ctx context.Context, prNumber int, method string) error

MergePullRequest merges a pull request

func (*Client) WaitForChecksToStart added in v1.2.1

func (c *Client) WaitForChecksToStart(ctx context.Context, prNumber int, timeout time.Duration) (string, *remote.PRChecks, error)

WaitForChecksToStart waits for CI checks to start for a PR This solves the race condition where CI hasn't started yet when we query

func (*Client) WatchPullRequestChecks

func (c *Client) WatchPullRequestChecks(ctx context.Context, prNumber int) (<-chan remote.PRChecksUpdate, error)

WatchPullRequestChecks streams updates for PR checks until all complete

func (*Client) WatchWorkflow

func (c *Client) WatchWorkflow(ctx context.Context, workflowID string) (<-chan remote.WorkflowUpdate, error)

WatchWorkflow streams updates for a running workflow

Jump to

Keyboard shortcuts

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