# Query GitHub PRs for December Activity

> Fetch all pull requests created in December 2024 from cli/cli repository using the GitHub CLI, applying correct date range filtering to ensure accurate total count and contributor identification.

- Skill: `cxcscmu/query-github-prs-for-december-activity` (Agent Skill)
- Install (CLI): `npx get-skill add cxcscmu/query-github-prs-for-december-activity`
- Raw SKILL.md: https://api.skillmd.com/api/skills/cxcscmu/query-github-prs-for-december-activity/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics
- Author: cxcscmu (https://skillmd.com/u/cxcscmu)
- Updated: 2026-11-24
- Page: https://skillmd.com/skills/cxcscmu/query-github-prs-for-december-activity

---


# Query GitHub PRs for December Activity

## Overview
Use `gh pr list` with proper date range syntax to retrieve all PRs created between 2024-12-01 and 2024-12-31 in the `cli/cli` repository.

## Step 1: Test the Search Syntax
First, verify the correct syntax for date range filtering with `gh pr list`:

```bash
gh pr list \
  --repo cli/cli \
  --state all \
  --search "created:2024-12-01..2024-12-31" \
  --json number,title,author,createdAt,mergedAt,closedAt,state \
  --limit 200
```

**Critical Notes:**
- `gh pr list` may NOT support `--search` flag directly — check `gh pr list --help`
- If `--search` doesn't work, you may need to use `gh api graphql` instead for complex date filtering
- Test this command **locally first** to confirm it returns results before using in scripts
- The date format `YYYY-MM-DD` should be ISO-8601 compatible
- Increase `--limit` if you expect more than 200 PRs

## Step 2: Verify Output Fields
Ensure the JSON output contains:
- `number`: PR identifier
- `author`: Object with `login` field (for top contributor)
- `createdAt`: ISO-8601 timestamp (for date range filtering)
- `mergedAt`: ISO-8601 timestamp or null (indicates merge status)
- `closedAt`: ISO-8601 timestamp or null
- `state`: Should be `MERGED`, `CLOSED`, or `OPEN` (verify actual values)

## Step 3: Parse and Count
From the returned JSON:
- Count total number of records returned
- Count records where `state == "MERGED"` (do NOT use mergedAt != null alone)
- Count records where `state == "CLOSED"` (and mergedAt == null to exclude merged PRs)
- Extract author login and count occurrences to find top contributor

## Troubleshooting
- If counts are still too high, check if `--search` is including PRs outside the date range
- Verify state values are exactly as expected (case-sensitive)
- Consider using GraphQL query if CLI flags prove unreliable
