Documentation
¶
Index ¶
- type Client
- func (c *Client) DispatchWorkflow(ctx context.Context, owner, repo, workflowFile, ref string) error
- func (c *Client) GetFileContent(ctx context.Context, owner, repo, path, ref string) (string, error)
- func (c *Client) GetInstallationRepos(ctx context.Context) ([]Repository, error)
- func (c *Client) GetVariable(ctx context.Context, owner, repo, name string) (string, error)
- func (c *Client) GetWorkflowFiles(ctx context.Context, owner, repo string) ([]WorkflowFile, error)
- func (c *Client) SetVariable(ctx context.Context, owner, repo, name, value string) error
- type CronAnnotation
- type CronJobKey
- type Repository
- type Transport
- type WorkflowFile
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 is a GitHub API client.
func (*Client) DispatchWorkflow ¶
DispatchWorkflow triggers a workflow_dispatch event.
func (*Client) GetFileContent ¶
GetFileContent returns the content of a file in a repository.
func (*Client) GetInstallationRepos ¶
func (c *Client) GetInstallationRepos(ctx context.Context) ([]Repository, error)
GetInstallationRepos returns all repositories accessible to the installation.
func (*Client) GetVariable ¶
GetVariable returns the value of a repository Actions variable.
func (*Client) GetWorkflowFiles ¶
GetWorkflowFiles returns workflow files under .github/workflows/.
type CronAnnotation ¶
type CronAnnotation struct {
Owner string // repository owner
Repo string // repository name
WorkflowFile string // workflow file name (e.g. "build.yml")
CronExpr string // cron expression (5-field format, optional CRON_TZ=/TZ= prefix)
Ref string // default branch
}
CronAnnotation represents a cron annotation extracted from a workflow file.
func (*CronAnnotation) Key ¶
func (a *CronAnnotation) Key() CronJobKey
Key generates a CronJobKey from a CronAnnotation.
type CronJobKey ¶
CronJobKey uniquely identifies a cron job.
type Repository ¶
Repository represents a GitHub App installation repository.
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is an http.RoundTripper that authenticates using a GitHub App installation token.
func NewTransport ¶
NewTransport creates a new Transport from an App ID and PEM-encoded private key.
type WorkflowFile ¶
type WorkflowFile struct {
Name string // file name (e.g. "build.yml")
Path string // full path (e.g. ".github/workflows/build.yml")
}
WorkflowFile represents a workflow file in a repository.