Skip to content
Back to skills

003 Name Skill A5a168c9

ASecurity

GitHub CLI (gh) commands for PR workflows - checking CI status, viewing failed test logs, creating and updating pull requests. Use when working with GitHub PRs, checking why CI failed, or managing PR metadata.

  • 9 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 31, 2026
toolsbashgitapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned May 31, 2026

npx -y skills add tools-only/X-Skills --skill 003-name-skill_a5a168c9 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 003 Name Skill A5a168c9?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 003 Name Skill A5a168c9
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-003-name-skill-a5a168c9/badge)](https://www.skillsdirectory.com/skills/tools-only-003-name-skill-a5a168c9)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: github-cli
description: GitHub CLI (gh) commands for PR workflows - checking CI status, viewing failed test logs, creating and updating pull requests. Use when working with GitHub PRs, checking why CI failed, or managing PR metadata.
---

# GitHub CLI for PR Workflows

Quick reference for `gh` commands focused on pull request workflows.

## Checking PR Status

```bash
# Check CI status for current branch's PR
gh pr checks

# Check specific PR
gh pr checks 123

# Watch until checks finish
gh pr checks --watch

# Only show required checks
gh pr checks --required

# JSON output for scripting
gh pr checks --json name,state,conclusion
```

Exit codes: `0` = passed, `1` = failed, `8` = pending

## Viewing Failed Test Logs

```bash
# View run summary (interactive picker if no ID)
gh run view

# View specific run with job details
gh run view <run-id> -v

# View logs for failed steps only (most useful)
gh run view <run-id> --log-failed

# View full log for a specific job
gh run view --job <job-id> --log

# Open in browser
gh run view <run-id> --web
```

To get job ID from a URL like `.../runs/123/job/456`, job ID is `456`.

## Creating PRs

```bash
# Interactive (prompts for title/body)
gh pr create

# With title and body
gh pr create --title "Fix bug" --body "Details here"

# Auto-fill from commit messages
gh pr create --fill

# Draft PR
gh pr create --draft

# With reviewers and labels
gh pr create -r reviewer1,reviewer2 -l bug,urgent

# Specify base branch
gh pr create --base develop
```

## Updating PRs

```bash
# Edit title/body
gh pr edit 123 --title "New title" --body "New body"

# Add/remove labels
gh pr edit 123 --add-label "bug" --remove-label "wip"

# Add/remove reviewers
gh pr edit 123 --add-reviewer alice --remove-reviewer bob

# Self-assign
gh pr edit 123 --add-assignee "@me"

# Change base branch
gh pr edit 123 --base main
```

## Other Useful Commands

```bash
# View PR details
gh pr view 123

# View PR in browser
gh pr view 123 --web

# List open PRs
gh pr list

# Checkout PR locally
gh pr checkout 123

# View PR comments
gh api repos/{owner}/{repo}/issues/123/comments

# Re-run failed jobs
gh run rerun <run-id> --failed
```

## Scripts

- `scripts/check-pr.sh` - Check PR status with optional watch mode
- `scripts/view-failed-logs.sh` - View failed logs for a run or job

Files in this skill

  • README.md785 B
  • skill.md2.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.