Documentation
¶
Overview ¶
Package github provides GitHub Actions CI provider implementation.
Index ¶
- Constants
- Variables
- 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) ResolveBase() (*provider.BaseResolution, error)
- 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 ¶
var ErrEventPathNotSet = fmt.Errorf("GITHUB_EVENT_PATH is not set")
ErrEventPathNotSet is returned when $GITHUB_EVENT_PATH is not set.
var ErrNoParentCommit = fmt.Errorf("HEAD has no parents (initial commit)")
ErrNoParentCommit is returned when HEAD has no parents (initial commit).
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 commit status 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) ResolveBase ¶ added in v1.214.0
func (p *Provider) ResolveBase() (*provider.BaseResolution, error)
ResolveBase returns the base commit for affected detection in GitHub Actions. It reads GitHub Actions environment variables and event payloads to determine the appropriate base commit for the current event type.
func (*Provider) UpdateCheckRun ¶
func (p *Provider) UpdateCheckRun(ctx context.Context, opts *provider.UpdateCheckRunOptions) (*provider.CheckRun, error)
UpdateCheckRun updates an existing commit status on a commit.