Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

watch-pull-request-checks

БесплатноБез исполняемых скриптовНе проверен

Wait for a pull request's CI checks to finish with gh pr checks, then read which failed. Use when you need to know whether CI passed after pushing to a PR.

torrustот torrust★ 539 звёзд на GitHub

Об этом скилле

Watching Pull-Request Checks

gh pr checks already does the waiting, so this repository ships no tool for it. Use it after you push, and use wait-for-pr-review for reviewer events, which gh pr checks does not report.

Prerequisites

  • GitHub CLI (gh), authenticated as the identity that should read the checks. Pass the pull request number and --repo torrust/torrust-tracker, because a fork-based pull request lives upstream.

Wait for the Checks

After a push, wait for the workflow checks with the loop in Review-Service Check Runs: this repository has review services that post check runs of their own, and --watch below waits for those too, although they do not count for readiness. Use --watch when every check run matters to you, or for a quick look at all of them:

mkdir -p .tmp
gh pr checks <PR> --repo torrust/torrust-tracker --watch --fail-fast --interval 60 \
  > .tmp/pr-checks.txt 2>&1
echo "exit=$?"

--watch repaints the whole table every interval, so redirect it to a file and read the last table, not the stream. --fail-fast stops at the first failing check instead of waiting for the slow ones. CI jobs take minutes, so an interval under 60 seconds only adds API calls.

Exit code Meaning
0 Every check finished and none failed (skipped checks do not count as failures).
1 At least one check failed, or the command failed.
8 Checks are still pending. Without --watch this is the normal answer to a single look.

Run the watcher in the background when your shell tool caps a call, and read the file when it exits. Right after a push the checks may not exist yet; if the command reports none, wait a few seconds and run it again.

Read the Result Without Watching

A single look is enough when you only need the state. The bucket field is one of pass, fail, pending, skipping or cancel:

gh pr checks <PR> --repo torrust/torrust-tracker --json name,bucket \
  --jq 'group_by(.bucket) | map({(.[0].bucket): length}) | add'
gh pr checks <PR> --repo torrust/torrust-tracker --json name,bucket,link \
  --jq '.[] | select(.bucket == "fail") | "\(.name) \(.link)"'

Review-Service Check Runs

A review service installed on the repository can post its own check run, for example CodeRabbit or Greptile Review. Such a check run comes from the service's GitHub App, not from a workflow of this repository, and it does not count for readiness: it neither blocks a pull request nor is waited for (ADR). Its review, if it posts one, goes through the review loop like any other.

gh pr checks reports an empty workflow for these check runs, so they can be left out without naming any service. --watch waits for every check run, theirs included, so it can keep waiting for a slow review service after CI has finished, and its exit code counts a failed review-service check as a failure. To wait for the workflow checks alone, poll them instead. The loop spends no tokens. It ends when at least one workflow check exists and none is pending, or when the workflow runs of the head commit wait for a maintainer's approval (see When Checks Never Start), or when a gh call fails:

mkdir -p .tmp
while :; do
  # Read the head on every pass, so both commands below look at the same commit even after a push.
  head=$(gh pr view <PR> --repo torrust/torrust-tracker --json headRefOid --jq .headRefOid) \
    || { echo "gh pr view failed; see its error above" >&2; break; }
  if ! ready=$(gh pr checks <PR> --repo torrust/torrust-tracker --json bucket,workflow \
    --jq '[.[] | select(.workflow != "")] | length > 0 and all(.bucket != "pending")' \
    2> .tmp/pr-checks-error.txt); then
    grep -q "^no checks reported" .tmp/pr-checks-error.txt \
      || { cat .tmp/pr-checks-error.txt; echo "gh pr checks failed" >&2; break; }
    ready=false   # no check exists yet: see whether the runs wait for approval
  fi
  [ "$ready" = true ] && { echo "workflow checks finished"; break; }
  waiting=$(gh run list --repo torrust/torrust-tracker --commit "$head" --json conclusion \
    --jq 'any(.[]; .conclusion == "action_required")') \
    || { echo "gh run list failed; see its error above" >&2; break; }
  [ "$waiting" = true ] && { echo "workflow runs of $head wait for a maintainer's approval"; break; }
  sleep 60
done > .tmp/pr-checks-wait.txt 2>&1

Read the last line of the file when the loop exits. With --json, gh pr checks exits 0 whether the checks pass, fail or are pending. It exits non-zero with no checks reported on the '<branch>' branch when the head has no check at all, which the loop treats as "not yet"; any other n

Полный SKILL.md на GitHub

Установить watch-pull-request-checks в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл watch-pull-request-checks?

Wait for a pull request's CI checks to finish with gh pr checks, then read which failed. Use when you need to know whether CI passed after pushing to a PR.

Как установить скилл watch-pull-request-checks?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл watch-pull-request-checks запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить watch-pull-request-checks с