Skip to content
GitHub

Understand results and commit status

Open

See each state of the shepherd commit status, what moves it between states, and how a branch rule uses it.

Each review in GitHub Actions sets the shepherd commit status on the head it reviewed. A branch rule can require it, so a pull request can’t merge while its review is running, refused, waiting on a person, or behind a push Shepherd hasn’t reviewed.

While the review runs, Shepherd also posts a “shepherd is reviewing” comment on the pull request with a link to the run. Shepherd deletes it when the run ends, and a later run deletes any that a cancelled run left behind.

To read the review itself, see Read and respond to a review.

stateDiagram-v2
    [*] --> pending: review starts
    pending --> success: approved, no open thread of shepherd's or a person's
    pending --> failure: changes needed, a person decides, or threads wait
    pending --> error: the review did not finish
    failure --> pending: new push or /review
    failure --> success: a person who can push approves an escalation
    error --> pending: new push or /review
    success --> pending: new push

Each state carries a description. Find the state in the first column:

StateDescriptionWhat it means
pendingshepherd is reviewing this headThe review is running
pendingnot reviewed: …Shepherd skipped a draft, or a pull request without the trigger label
successapproved; no open threadThe review approved, and no thread of Shepherd’s or a person’s is open
successapproved by <person>The review escalated, and someone who can push approved the head
failurechanges needed: …The review refused
failurea person decides: …The review escalated, and nobody has approved yet
failureapproved; N open thread(s) to resolveThe review approved, but threads are still open
errorthe review did not finish; comment /review to run it againThe review stopped before a verdict

Someone who can push approves the head on GitHub, during the review or after it. If no thread of Shepherd’s or a person’s is open, Shepherd sets success, approved by <person>. These cases change that:

  • Dismissed approval: dismissing the approval sets failure again.
  • Resolved threads: GitHub sends no event for a resolved thread. After you resolve the last one, approve again or submit any review, and Shepherd updates the status.
  • Forks: on a pull request from a fork, an approval can’t change the status, because GitHub gives that event a read-only token. An escalated fork pull request stays failure, and someone allowed to bypass the branch rule merges it.

Shepherd posts its review as a COMMENT and never approves on GitHub. A person approves the pull request.

shepherd status <pr> shows the review, the shepherd status, CI and open threads on the pull request’s head as one stage, with the next step.

From your coding agent, /shepherd <pr> also sets the shepherd status, through your account. /shepherd --local sets none.