Skip to main content

Module github

Module github 

Source
Expand description

GitHub Action / remote PR workflow helpers.

These functions thinly wrap the gh CLI so that workflow steps can call sparrow github review|status|logs from inside an Action. They never invent results: a missing gh binary or missing GITHUB_TOKEN returns a clear error.

Structs§

ReviewPlan

Functions§

ci_logs
Returns gh run view <id> --log as raw text. Used by sparrow github logs.
ci_status
Returns gh run list --limit 5 as raw text. Used by sparrow github status.
fetch_pr_diff
Fetch the diff for pr via gh pr diff <pr>. Returns the stdout text on success, otherwise an error that includes stderr — never a silent empty string.
gh_available
plan_review
Builds a ReviewPlan from inputs. With dry_run = true this never shells out and is safe in tests.
require_action_env
Returns Err with a clear message when the environment is not set up for GitHub Action use. Used by every subcommand so the action fails loudly when secrets are missing instead of silently no-oping.