Tutorials 14

Lesson 14 — OpenClaw GitHub Skill: Let AI Automatically Manage Issues, Submit PRs, and Check CI Results (2026)

Goal: Install the GitHub Skill to let OpenClaw handle everyday GitHub development tasks through natural language using the gh CLI.


Prerequisite: Install and Configure the gh CLI

The GitHub Skill depends on the official gh CLI tool. If you haven't installed it, do this first:

# macOS
brew install gh
 
# Linux (Debian/Ubuntu)
sudo apt install gh
 
# Windows (winget)
winget install --id GitHub.cli

After installation, log in:

gh auth login

Follow the prompts:

? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations? HTTPS
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Login with a web browser

! First copy your one-time code: XXXX-XXXX
Press Enter to open github.com in your browser...

Verify after login:

gh auth status
# Should show: ✓ Logged in to github.com as <your-username>

The key prerequisite for using the GitHub Skill is a properly logged-in gh — the GitHub Skill interacts with the GitHub API by calling gh commands, so you don't need to configure a separate Personal Access Token.


Step 1: Install GitHub Skill

/install @steipete/github

Verify after installation:

pnpm openclaw skills list
# github should appear in the list

Step 2: Issue Management

Common commands for managing GitHub Issues:

Create an Issue in myorg/myrepo: title "Payment Module Null Pointer Exception", description "Occasional NPE during payment callback handling under high concurrency, stack trace attached", labels: bug, high-priority
Show the latest 10 open Issues in myorg/myrepo
Search for all Issues in myorg/myrepo containing the keyword "timeout"
Close Issue #234 with the note "Fixed in PR #456"
Add label needs-review to Issue #234 and assign it to @alice

AI automatically calls the corresponding gh commands and returns the results:

# Command actually executed by the Skill (visible to you)
gh issue create --repo myorg/myrepo \
  --title "Payment Module Null Pointer Exception" \
  --body "Occasional NPE during payment callback handling under high concurrency..." \
  --label "bug,high-priority"
# ✅ Issue #235 created: https://github.com/myorg/myrepo/issues/235

Step 3: PR Operations

PR-related operations:

Show all pending PRs in myorg/myrepo
View the diff for PR #456 and tell me the main changes
Write a review comment for PR #456: Overall logic is clear, but error handling at line 38 needs logging added — recommend using the unified ErrorHandler pattern
Create a PR in myorg/myrepo: merge branch feature/payment-refactor into main, title "Refactor Payment Gateway Module", description with change summary
Approve and merge PR #456 (squash merge)

Before executing destructive operations like merging, AI will ask for your confirmation:

About to merge PR #456 into main (squash merge). Confirm? [y/N]

Step 4: CI / Actions Status

Common commands for checking CI:

Show the last 5 CI run statuses in myorg/myrepo
The CI for PR #456 failed — tell me why
Re-trigger the CI pipeline for PR #456
Show the detailed logs for the most recent run of the "Deploy to Production" workflow

AI will automatically extract the failed step and key error message, so you don't have to dig through lengthy logs yourself:

CI Failure Analysis (Run #1234):
  Failed Step: Run tests
  Error Type: Test timeout (30s limit exceeded)
  Failed Test: PaymentServiceTest.testHighConcurrency
  Suggestion: Increase test timeout configuration or optimize this test case

Step 5: Advanced — Complex Queries with gh api

For scenarios not covered by built-in Skill commands, use gh api for custom queries:

Use gh api to query all PRs merged in myorg/myrepo in the last 30 days, listing author and merge time
Use gh api to get star counts for all repos in the myorg organization, sorted in descending order

AI will construct the appropriate GraphQL or REST query:

gh api graphql -f query='
  query {
    repository(owner: "myorg", name: "myrepo") {
      pullRequests(states: MERGED, last: 50, orderBy: {field: UPDATED_AT, direction: DESC}) {
        nodes {
          title
          author { login }
          mergedAt
        }
      }
    }
  }
'

The key advantage of using the GitHub Skill over GitHub Copilot: the GitHub Skill isn't just code completion — it's complete repository operations automation, covering the entire development workflow from Issues to CI.


Step 6: Daily Repository Activity Report

Turn it into a daily morning routine:

Give me a repo activity report for myorg/myrepo:
1. New Issues from yesterday (sorted by priority)
2. PRs waiting for my review
3. Failed CI pipelines

Combined with the ontology Skill (Lesson 12), AI can relate these updates to the project context you've already built:

PR #460 is from Alice Chen, related to the "Payment System Refactor" project, high priority — recommend reviewing soon.

FAQ

Can OpenClaw help me auto-merge PRs?

Yes, but AI will always ask for confirmation before any merge operation — it won't silently execute destructive actions. You can explicitly tell AI "approve and merge PR #456, no need to confirm again" and it will execute directly. For fully automated merges (like auto-merging after CI passes), combine OpenClaw's scheduled task feature to set up conditional triggers.

Does the GitHub Skill need a Personal Access Token?

No separate Personal Access Token needed. The GitHub Skill directly reuses the already-logged-in gh CLI credentials — just complete gh auth login before installing the Skill. gh CLI uses OAuth Device Flow authorization, which is more secure than manually managing PATs, and the permission scope is controlled by GitHub officially.

What's the difference between GitHub Skill and GitHub Copilot?

They serve completely different purposes. GitHub Copilot is a code writing aid tool, mainly doing code completion and suggestions inside an IDE. GitHub Skill is a repository operations automation tool — it lets you handle Issue management, PR review, CI monitoring, and other development workflow tasks through natural language, without touching code writing itself. They can be used simultaneously without conflict. GitHub Skill is especially valuable for developers not using VS Code (e.g., Neovim or terminal-heavy workflows).

Can I manage multiple GitHub repositories simultaneously?

Yes. Just specify different repository names in your instructions — there's no limit. For example:

Check pending PRs in myorg/frontend and myorg/backend, and compile them into a single list

For repos that belong to private organizations, just make sure your gh auth login account has access to those repos — no extra configuration needed.


Next Steps

  • Lesson 15 — Next advanced technique
  • Lesson 13 — Use the Gog Skill to connect Gmail and Google Calendar, integrating GitHub updates into a complete daily work report

Stay up to date with OpenClaw

Follow @lanmiaoai on X for tips, updates and new tutorials.

Follow