Documentation
¶
Overview ¶
Package github implements `sf github ci` — a compact view of a repo's GitHub Actions runs via the `gh` CLI, with an optional `--watch` that blocks until the latest run finishes and prints only its final status (instead of gh's verbose live stream). Targets a single package dir (by name) or the current repo.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCommand ¶
NewCommand returns the `github` group (`sf github …`).
func RunBranches ¶
func RunBranches(opts BranchOptions, w io.Writer) error
RunBranches reports non-default branches across the viewer's own repos and, with --delete, removes the ones whose PR is already merged (or closed).
Types ¶
type Branch ¶
type Branch struct {
Repo string `json:"repo"` // nameWithOwner
Branch string `json:"branch"` // head ref name (may contain slashes)
AgeDays int `json:"age_days"`
PR string `json:"pr"` // "MERGED#11" | "OPEN#15" | "CLOSED#4" | "none"
Status string `json:"status"` // merged | closed | open | no-pr
}
Branch is one non-default branch on an owned repo, reduced to what you need to decide whether it can go: where it lives, how stale it is, and the state of the pull request it belongs to (the source of truth for "already merged").
type BranchOptions ¶
type BranchOptions struct {
Format string
Delete string // "" (report only) | "merged" | "closed" (closed implies merged)
Refs int // max branches fetched per repo
}
BranchOptions controls a `github branches` run.
type Options ¶
type Options struct {
Root string
Target string // package name / dir basename / path; empty = current repo
Format string
Limit int
Watch bool
Timeout time.Duration
Poll time.Duration
}
Options controls a `github ci` run.
type PR ¶
type PR struct {
Repo string `json:"repo"`
Number int `json:"number"`
CI string `json:"ci"` // statusCheckRollup.state, normalised (SUCCESS/FAILURE/PENDING/NONE)
Review string `json:"review"` // reviewDecision (APPROVED/CHANGES_REQUESTED/REVIEW_REQUIRED/NONE)
Role string `json:"role"` // author | reviewer | "–" (open PR on your repo, e.g. a bot's)
Draft bool `json:"draft"`
Title string `json:"title"`
URL string `json:"url"`
}
PR is one open pull request across the user's repos, collapsed to the few fields an agent actually needs to triage it: where it lives, its CI rollup, its review verdict, and the user's role on it.
type PkgCI ¶
PkgCI is one package's latest CI run in the aggregate (tree) view. The embedded Run is zero when the package has no runs or could not be probed.
type Run ¶
type Run struct {
ID int64 `json:"id"`
Workflow string `json:"workflow"`
Status string `json:"status"`
Conclusion string `json:"conclusion"`
Branch string `json:"branch"`
Event string `json:"event"`
Title string `json:"title"`
CreatedAt string `json:"created"`
}
Run is one GitHub Actions workflow run.