Fetch Bug-Fix PRs Skill
This skill fetches pull requests that are bug fixes with linked issues from a GitHub repository.
Usage
Run the fetch.sh script with the following parameters:
bash
./fetch.sh --repo <owner/repo> --since <YYYY-MM-DD> --until <YYYY-MM-DD> [--author <username>] [--output <path>]
Parameters
| Parameter | Required | Description | Example |
|---|---|---|---|
--author | No | GitHub username of the PR author | osortega |
--repo | Yes | Repository in owner/repo format | microsoft/vscode |
--since | Yes | Start date (inclusive) | 2025-12-02 |
--until | Yes | End date (inclusive) | 2026-02-02 |
--output | No | Output file path (default: data/prs-with-issues.md) | ./results.md |
Example
bash
# Fetch all bug-fix PRs from the last 2 months ./.github/skills/fetch-bugfix-prs/fetch.sh \ --repo microsoft/vscode \ --since 2025-12-02 \ --until 2026-02-02 # Fetch Osvaldo's bug-fix PRs from the last 2 months ./.github/skills/fetch-bugfix-prs/fetch.sh \ --author osortega \ --repo microsoft/vscode \ --since 2025-12-02 \ --until 2026-02-02
Output Format
The script generates a markdown file with a table:
| PR # | PR Title | Issue # | Issue Title | Merge Commit | Parent Commit | Labels |
|---|
How It Works
- •Uses
ghCLI to search for PRs by author in the date range - •Filters for bug fixes by checking:
- •Labels containing "bug", "fix", or "regression"
- •Title containing "fix", "fixes", "fixed", "resolve", "closes"
- •Extracts linked issues from:
- •PR title (e.g., "Fixes #12345")
- •PR body (GitHub issue references)
- •Timeline events (linked issues via GitHub UI)
- •Fetches issue details for each linked issue
- •Gets merge commit and its parent for each PR
Prerequisites
- •
ghCLI installed and authenticated - •
jqfor JSON processing