Documentation
¶
Overview ¶
Package githubcmd provides support for building command line tools that access the GitHub Actions API.
Index ¶
- func OptionsForEndpoint(cfg apicrawlcmd.Crawl[Service]) ([]operations.Option, error)
- type Command
- func (c *Command) GetJob(ctx context.Context, _ *GetJobFlags, args []string) error
- func (c *Command) GetRun(ctx context.Context, _ *GetRunFlags, args []string) error
- func (c *Command) ListJobs(ctx context.Context, fv *ListJobsFlags, runID int64) error
- func (c *Command) ListRunners(ctx context.Context, fv *ListRunnersFlags) error
- func (c *Command) ListRuns(ctx context.Context, fv *ListRunsFlags) error
- type GetJobFlags
- type GetRunFlags
- type ListJobsFlags
- type ListRunnersFlags
- type ListRunsFlags
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OptionsForEndpoint ¶
func OptionsForEndpoint(cfg apicrawlcmd.Crawl[Service]) ([]operations.Option, error)
OptionsForEndpoint returns the operations.Option slice for making API requests with the auth and rate-control settings from cfg.
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command implements the GitHub Actions API command line operations.
func NewCommand ¶
func NewCommand(ctx context.Context, config apicrawlcmd.Crawl[yaml.Node], resources apicrawlcmd.Resources) (*Command, error)
NewCommand returns a new Command for GitHub Actions API commands.
func (*Command) GetJob ¶
GetJob retrieves the job for each job ID supplied as an argument and prints it to stdout.
func (*Command) GetRun ¶
GetRun retrieves the workflow run for each run ID supplied as an argument and prints it to stdout.
func (*Command) ListJobs ¶
ListJobs iterates over all jobs for the specified workflow run ID and prints each job to stdout.
func (*Command) ListRunners ¶
func (c *Command) ListRunners(ctx context.Context, fv *ListRunnersFlags) error
ListRunners iterates over all self-hosted runners for the configured repo and prints each runner to stdout.
func (*Command) ListRuns ¶
func (c *Command) ListRuns(ctx context.Context, fv *ListRunsFlags) error
ListRuns iterates over all workflow runs for the configured repo and prints each run to stdout. Runs are retrieved using the scanner/paginator pattern and optional filters can be applied via ListRunsFlags.
type ListJobsFlags ¶
type ListJobsFlags struct {
Filter string `subcmd:"filter,latest,'jobs to include: latest (default) or all attempts'"`
PageSize int `subcmd:"size,30,'number of items per page (max 100)'"`
}
ListJobsFlags are the flags for the ListJobs command.
type ListRunnersFlags ¶
type ListRunnersFlags struct {
PageSize int `subcmd:"size,30,'number of items per page (max 100)'"`
}
ListRunnersFlags are the flags for the ListRunners command.
type ListRunsFlags ¶
type ListRunsFlags struct {
Branch string `subcmd:"branch,,'filter runs by branch name'"`
Status string `subcmd:"status,,'filter by status: completed, in_progress, queued, etc.'"`
Event string `subcmd:"event,,'filter by triggering event: push, pull_request, schedule, etc.'"`
Actor string `subcmd:"actor,,'filter by the login of the user who triggered the run'"`
PageSize int `subcmd:"size,30,'number of items per page (max 100)'"`
}
ListRunsFlags are the flags for the ListRuns command.
type Service ¶
type Service struct {
Owner string `yaml:"owner" cmd:"repository owner (user or organization)"`
Repo string `yaml:"repo" cmd:"repository name"`
PerPage int `yaml:"per_page" cmd:"number of results per page (max 100, default 30)"`
}
Service represents the GitHub-specific configuration for API access.