github

package
v1.208.0-test.7 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: Apache-2.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package github provides GitHub Actions CI provider implementation.

Index

Constants

View Source
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

func NewClient() (*Client, error)

NewClient creates a new GitHub API client. It uses the GITHUB_TOKEN environment variable for authentication.

func NewClientWithHTTPClient

func NewClientWithHTTPClient(httpClient *http.Client) *Client

NewClientWithHTTPClient creates a new GitHub API client with a custom HTTP client. Useful for testing.

func NewClientWithToken

func NewClientWithToken(token string) *Client

NewClientWithToken creates a new GitHub API client with the given token.

func (*Client) GitHub

func (c *Client) GitHub() *github.Client

GitHub returns the underlying go-github client.

type Provider

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

Provider implements provider.Provider for GitHub Actions.

func NewProvider

func NewProvider() (*Provider, error)

NewProvider creates a new GitHub Actions provider.

func NewProviderWithClient

func NewProviderWithClient(client *Client) *Provider

NewProviderWithClient creates a new GitHub Actions provider with a custom client.

func (*Provider) Context

func (p *Provider) Context() (*provider.Context, error)

Context returns CI metadata from GitHub Actions environment variables.

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) Detect

func (p *Provider) Detect() bool

Detect returns true if running in GitHub Actions.

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) Name

func (p *Provider) Name() string

Name returns the provider name.

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.

Jump to

Keyboard shortcuts

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