Documentation
¶
Overview ¶
Package github provides GitHub Actions CI provider implementation.
Index ¶
- Constants
- type Client
- type Provider
- func (p *Provider) Context() (*provider.Context, error)
- func (p *Provider) CreateCheckRun(ctx context.Context, opts *provider.CreateCheckRunOptions) (*provider.CheckRun, error)
- func (p *Provider) Detect() bool
- func (p *Provider) GetStatus(ctx context.Context, opts provider.StatusOptions) (*provider.Status, error)
- func (p *Provider) Name() string
- func (p *Provider) OutputWriter() provider.OutputWriter
- func (p *Provider) UpdateCheckRun(ctx context.Context, opts *provider.UpdateCheckRunOptions) (*provider.CheckRun, error)
Constants ¶
const (
// ProviderName is the name of the GitHub Actions provider.
ProviderName = "github-actions"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the GitHub API client.
func NewClient ¶
NewClient creates a new GitHub API client. It uses the GITHUB_TOKEN environment variable for authentication.
func NewClientWithHTTPClient ¶
NewClientWithHTTPClient creates a new GitHub API client with a custom HTTP client. Useful for testing.
func NewClientWithToken ¶
NewClientWithToken creates a new GitHub API client with the given token.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements provider.Provider for GitHub Actions. The client is lazily initialized on first use, so the provider can be registered at init time based on environment detection alone, without requiring GITHUB_TOKEN to be available at startup.
func NewProvider ¶
func NewProvider() *Provider
NewProvider creates a new GitHub Actions provider. The GitHub API client is lazily initialized on first use.
func NewProviderWithClient ¶
NewProviderWithClient creates a new GitHub Actions provider with a custom client.
func (*Provider) CreateCheckRun ¶
func (p *Provider) CreateCheckRun(ctx context.Context, opts *provider.CreateCheckRunOptions) (*provider.CheckRun, error)
CreateCheckRun creates a new check run on a commit.
func (*Provider) GetStatus ¶
func (p *Provider) GetStatus(ctx context.Context, opts provider.StatusOptions) (*provider.Status, error)
GetStatus returns the CI status for the current branch.
func (*Provider) OutputWriter ¶
func (p *Provider) OutputWriter() provider.OutputWriter
OutputWriter returns an OutputWriter for GitHub Actions.
func (*Provider) UpdateCheckRun ¶
func (p *Provider) UpdateCheckRun(ctx context.Context, opts *provider.UpdateCheckRunOptions) (*provider.CheckRun, error)
UpdateCheckRun updates an existing check run.