Documentation
¶
Overview ¶
Package github implements RepoAdapter and DeployAdapter using the GitHub API.
Index ¶
- type DeployClient
- type RepoClient
- func (r *RepoClient) ListPRs(ctx context.Context, repos []string, specID string) ([]adapter.PullRequest, error)
- func (r *RepoClient) PRStatus(ctx context.Context, repo string, prNumber int) (*adapter.PRDetail, error)
- func (r *RepoClient) RequestedReviews(ctx context.Context, user string) ([]adapter.PullRequest, error)
- func (r *RepoClient) SetPRDescription(ctx context.Context, repo string, prNumber int, body string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeployClient ¶
type DeployClient struct {
// contains filtered or unexported fields
}
DeployClient implements adapter.DeployAdapter using GitHub Actions workflow dispatch.
func NewDeployClient ¶
func NewDeployClient(token, owner, workflow string) *DeployClient
NewDeployClient creates a GitHub Actions DeployAdapter. workflow is the workflow file name (e.g., "deploy.yml") to dispatch.
func (*DeployClient) Status ¶
func (d *DeployClient) Status(ctx context.Context, run *adapter.DeployRun) (*adapter.DeployStatus, error)
Status polls a deployment run for its current state.
func (*DeployClient) Trigger ¶
func (d *DeployClient) Trigger(ctx context.Context, repos []string, env string) (*adapter.DeployRun, error)
Trigger dispatches a workflow_dispatch event for each repo targeting the given environment. It creates a deployment run per repo and returns the first one (callers can extend for multi-repo).
type RepoClient ¶
type RepoClient struct {
// contains filtered or unexported fields
}
RepoClient implements adapter.RepoAdapter using the GitHub REST API.
func NewRepoClient ¶
func NewRepoClient(token string, owner string) *RepoClient
NewRepoClient creates a GitHub RepoAdapter from a token and org/owner name.
func (*RepoClient) ListPRs ¶
func (r *RepoClient) ListPRs(ctx context.Context, repos []string, specID string) ([]adapter.PullRequest, error)
ListPRs returns open PRs matching a spec's branch pattern across its repos. It searches for branches prefixed with "spec-<id>/" (lowercased, stripped of the SPEC- prefix).
func (*RepoClient) PRStatus ¶
func (r *RepoClient) PRStatus(ctx context.Context, repo string, prNumber int) (*adapter.PRDetail, error)
PRStatus returns the review/CI status of a specific PR.
func (*RepoClient) RequestedReviews ¶
func (r *RepoClient) RequestedReviews(ctx context.Context, user string) ([]adapter.PullRequest, error)
RequestedReviews returns PRs where the given user is a requested reviewer.
func (*RepoClient) SetPRDescription ¶
func (r *RepoClient) SetPRDescription(ctx context.Context, repo string, prNumber int, body string) error
SetPRDescription updates a PR's body text.