| name | fetch-bugfix-prs |
| description | Fetch bug-fix PRs with linked issues from a GitHub repository. Use this when asked to find PRs that fix bugs, especially when needing to analyze the relationship between PRs and their linked issues. |
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:
./fetch.sh --repo <owner/repo> --since <YYYY-MM-DD> --until <YYYY-MM-DD> [--author <username>] [--issue-label <label>[,<label>...]] [--output <path>]
Parameters
| Parameter | Required | Description | Example |
|---|
--author | No | GitHub username of the PR author | osortega |
--issue-label | No | Only keep linked issues whose labels contain one of these values | bug |
--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
./.github/skills/fetch-bugfix-prs/fetch.sh \
--repo microsoft/vscode \
--since 2025-12-02 \
--until 2026-02-02
./.github/skills/fetch-bugfix-prs/fetch.sh \
--author osortega \
--repo microsoft/vscode \
--since 2025-12-02 \
--until 2026-02-02
./.github/skills/fetch-bugfix-prs/fetch.sh \
--repo microsoft/vscode \
--since 2026-03-01 \
--until 2026-03-31 \
--issue-label bug \
--output data/prs-with-issues-2026-03.md
Output Format
The script generates a markdown file with a table:
| PR # | PR Title | Issue # | Issue Title | Issue Labels | PR Created | Issue Created | Valid | Merge Commit | Parent Commit |
|---|
How It Works
- Uses
gh CLI 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 and optionally filters by issue labels
- Gets merge commit and its parent for each PR
Prerequisites
gh CLI installed and authenticated
jq for JSON processing
Rate Limits
GitHub CLI calls are retried on primary/secondary rate-limit responses. Tune with:
GH_RETRY_MAX - retry attempts, default 5
GH_RETRY_BASE_DELAY - fallback delay multiplier in seconds, default 10
GH_RETRY_MAX_DELAY - maximum sleep between retries in seconds, default 300
Authentication and SSO failures are not retried.