Back to the collection
Github·Development

github Skill: Read a PR Status Brief in OpenClaw

On this page

The github Skill lets OpenClaw read repository information through GitHub CLI (gh). Start with a PR status brief: determine whether a pull request is waiting for checks, needs review, or has a failure worth investigating. Bring an accurate PR URL and a GitHub account with access to that repository.

Check the Skill, then prepare gh

Open a terminal on the machine running OpenClaw:

Command
openclaw skills info github
openclaw skills check

Use the bundled github Skill if it is already present; you do not need another copy. The current bundled version declares a gh dependency. The shorter ClawHub @steipete/github version 1.0.0 does not, so finding the Skill does not establish that its CLI is installed or authenticated.

Only if the Skill is absent and you want this ClawHub version, use the current OpenClaw installation entry point:

Command
openclaw skills install @steipete/github --version 1.0.0

Check it again afterward. With multiple Agents, target the actual Agent using openclaw skills info github --agent YOUR_AGENT_ID and openclaw skills check --agent YOUR_AGENT_ID, replacing the ID. Inspecting the wrong workspace can make an installed Skill appear available when the current conversation cannot use it. If that Agent also needs the registry version installed, target it during installation too:

Command
openclaw skills install @steipete/github --version 1.0.0 --agent YOUR_AGENT_ID

gh is a separate tool. On macOS with Homebrew, install it on the machine where the Agent executes commands:

Command
brew install gh
gh --version
gh auth status --hostname github.com

Keep an existing working login. If no usable login exists, run the following in your terminal, finish the GitHub browser authorization, and check authentication again:

Command
gh auth login --hostname github.com --web

The task below is read-only; the login credentials may also permit writes. Access to private repositories and Actions logs depends on the actual account and token permissions.

Your first OpenClaw input

Replace the URL, then enter this in an OpenClaw conversation:

Prompt
Use the github Skill to produce a read-only status brief for
https://github.com/OWNER/REPO/pull/NUMBER.

Confirm the repository, PR title, state, draft status, current head SHA,
and review decision. List every check, distinguishing pass, fail, pending,
skipped and cancelled, with its details link.
For a failed GitHub Actions check, identify the corresponding run/job and
key error first. If logs cannot be read, state the gap without guessing.
Finish with what needs to wait, who needs to review, and what merits investigation.
Do not comment, edit code, rerun workflows, approve, or merge this PR.

You do not need to clone the repository for this remote read. A complete PR URL identifies the target independently of the current Git directory. Move to a checked-out repository when you later want to fix code.

Compare the brief with the original results

These commands read the same PR independently in a terminal. Replace PR_URL with the real URL before running the last two lines:

Command
PR_URL="https://github.com/OWNER/REPO/pull/NUMBER"
gh pr view "$PR_URL" --json number,title,state,isDraft,reviewDecision,headRefOid,url
gh pr checks "$PR_URL" --json name,bucket,state,link

Check four things:

  1. The right target. Repository, PR number and title match. state separates open, closed and merged; isDraft is a separate draft flag.
  2. Review and CI remain distinct. Green checks do not substitute for reviewDecision. If it is empty, report no decision returned rather than inventing approval.
  3. Every check is represented. bucket groups checks into pass, fail, pending, skipping and cancel. Keep waiting, skipped and cancelled items distinct. No check records does not mean everything passed.
  4. The brief still describes the current PR. Retain the observed headRefOid and details links. Read the status again after a new push instead of applying an old brief to new code.

An exit code of 8 from gh pr checks means checks are pending, not that the tool failed to work. Add --required when you specifically want required checks, but label that as a filtered view rather than all checks.

Follow a failed check to its logs

Open the failed item's link first. If it points to GitHub Actions, find /actions/runs/RUN_ID in the page URL and confirm that it is the run linked to this PR's check. External CI links belong to that provider; the Actions log commands do not apply to them.

Replace OWNER/REPO and RUN_ID, then inspect that run in the terminal:

Command
gh run view RUN_ID --repo OWNER/REPO --json status,conclusion,event,headSha,url,jobs,attempt

Take databaseId from the failed entry in the jobs array and use it as JOB_ID. This is the job ID, not the run ID. Then read that job:

Command
gh run view RUN_ID --repo OWNER/REPO --job JOB_ID --log-failed

A PR number, run ID and job ID are different identifiers. Do not substitute the repository's newest run or an old run from a similarly named branch. A pull_request workflow may check out a merge branch by default, making its GITHUB_SHA different from the PR source branch head. Follow the PR check link and inspect its run, event and commit context instead of relying on a single SHA filter.

Find the first substantive error before downstream failures. If the run is unfinished, keep the conclusion pending. This task produces a traceable status and investigation entry point. For code repair, continue with the gh-fix-ci guide.

Three common blockers

It works in your terminal but OpenClaw is unauthenticated. Ask the Agent to run gh --version and gh auth status --hostname github.com in its own execution environment. A Gateway may use another machine, container or user. Its PATH and configuration directory can differ from the desktop terminal. GH_CONFIG_DIR controls the configuration location; process-level GH_TOKEN / GITHUB_TOKEN take precedence over stored credentials. Check the service environment without pasting tokens into chat or using --show-token.

A private PR or log cannot be read. Check the account, repository URL and access, followed by any organization authorization requirements. Not found or unreadable does not mean closed or passed. A fine-grained token needs Actions read permission for job logs in its target repository; access to a public repository establishes nothing about this private one.

Logs are empty or a large download fails. First confirm that the job has finished and the ID is correct. The current gh run view manual documents limits around log association, missing jobs and UNKNOWN STEP. In issue #11059, ptorgalmath-gpsw reported a large run-log archive download failure on gh 2.74.0. A maintainer suggested reading the individual job logs, which the reporter subsequently said worked. This is a troubleshooting branch, not a claim that every current version has the same failure. [13]

For a confirmed job, use the official individual-job log endpoint:

Command
gh api repos/OWNER/REPO/actions/jobs/JOB_ID/logs

It returns the entire job's raw text rather than the failed-step filtering of --log-failed. If it remains unavailable, retain the check link, exact error and unresolved question so the brief shows where the investigation stopped.

How did your first task go?

These choices help us understand where readers get stuck through site analytics. Blocking analytics may prevent delivery; use email for a specific issue.

References

  1. github SKILL.md — @steipete/github 1.0.0steipete
  2. OpenClaw github SKILL.mdOpenClaw maintainers
  3. OpenClaw Skills CLIOpenClaw maintainers
  4. Installing gh on macOSGitHub CLI maintainers
  5. gh auth loginGitHub CLI maintainers
  6. gh auth statusGitHub CLI maintainers
  7. gh pr viewGitHub CLI maintainers
  8. gh pr checksGitHub CLI maintainers
  9. gh run listGitHub CLI maintainers
  10. gh run viewGitHub CLI maintainers
  11. Events that trigger workflows — pull_requestGitHub
  12. Download job logs for a workflow runGitHub
  13. Unable to view job logs gh run view --log — #11059ptorgalmath-gpsw; GitHub CLI maintainers ·
  14. gh environment variablesGitHub CLI maintainers
  15. GitHub CLI v2.102.0 — run/job JSON fieldsGitHub CLI maintainers
Found outdated or incorrect information? Let us know

Keep exploring

More skills worth getting to know.