diff --git a/.github/workflows/release.lock.yml b/.github/workflows/release.lock.yml index 6cea878780c..a6a49bd0781 100644 --- a/.github/workflows/release.lock.yml +++ b/.github/workflows/release.lock.yml @@ -23,7 +23,7 @@ # # Build, test, and release gh-aw extension, then generate and prepend release highlights # -# gh-aw-metadata: {"schema_version":"v1","frontmatter_hash":"7bac240d8646b61e0b920ab0aaf714c94e7290cd6476e767d9d695b9431cf50d"} +# gh-aw-metadata: {"schema_version":"v1","frontmatter_hash":"c9c4b4ced1984841d73234d18c94441f083f894b09c6ab199f4abdde881319e0"} name: "Release" "on": @@ -271,7 +271,7 @@ jobs: RELEASE_ID: ${{ needs.release.outputs.release_id }} RELEASE_TAG: ${{ needs.config.outputs.release_tag }} name: Setup environment and fetch release data - run: "set -e\nmkdir -p /tmp/gh-aw/release-data\n\n# Use the release ID and tag from the release job\necho \"Release ID from release job: $RELEASE_ID\"\necho \"Release tag from release job: $RELEASE_TAG\"\n\necho \"Processing release: $RELEASE_TAG\"\necho \"RELEASE_TAG=$RELEASE_TAG\" >> \"$GITHUB_ENV\"\n\n# Get the current release information\n# Use release ID to fetch release data\ngh api \"/repos/${{ github.repository }}/releases/$RELEASE_ID\" > /tmp/gh-aw/release-data/current_release.json\necho \"✓ Fetched current release information\"\n\n# Get the previous release to determine the range\nPREV_RELEASE_TAG=$(gh release list --limit 2 --json tagName --jq '.[1].tagName // empty')\n\nif [ -z \"$PREV_RELEASE_TAG\" ]; then\n echo \"No previous release found. This appears to be the first release.\"\n echo \"PREV_RELEASE_TAG=\" >> \"$GITHUB_ENV\"\n touch /tmp/gh-aw/release-data/pull_requests.json\n echo \"[]\" > /tmp/gh-aw/release-data/pull_requests.json\nelse\n echo \"Previous release: $PREV_RELEASE_TAG\"\n echo \"PREV_RELEASE_TAG=$PREV_RELEASE_TAG\" >> \"$GITHUB_ENV\"\n \n # Get commits between releases\n echo \"Fetching commits between $PREV_RELEASE_TAG and $RELEASE_TAG...\"\n git fetch --unshallow 2>/dev/null || git fetch --depth=1000\n \n # Get all merged PRs between the two releases\n echo \"Fetching pull requests merged between releases...\"\n PREV_PUBLISHED_AT=$(gh release view \"$PREV_RELEASE_TAG\" --json publishedAt --jq .publishedAt)\n CURR_PUBLISHED_AT=$(gh release view \"$RELEASE_TAG\" --json publishedAt --jq .publishedAt)\n gh pr list \\\n --state merged \\\n --limit 1000 \\\n --json number,title,author,labels,mergedAt,url,body \\\n --jq \"[.[] | select(.mergedAt >= \\\"$PREV_PUBLISHED_AT\\\" and .mergedAt <= \\\"$CURR_PUBLISHED_AT\\\")]\" \\\n > /tmp/gh-aw/release-data/pull_requests.json\n \n PR_COUNT=$(jq length \"/tmp/gh-aw/release-data/pull_requests.json\")\n echo \"✓ Fetched $PR_COUNT pull requests\"\nfi\n\n# Get the CHANGELOG.md content around this version\nif [ -f \"CHANGELOG.md\" ]; then\n cp CHANGELOG.md /tmp/gh-aw/release-data/CHANGELOG.md\n echo \"✓ Copied CHANGELOG.md for reference\"\nfi\n\n# List documentation files for linking\nfind docs -type f -name \"*.md\" 2>/dev/null > /tmp/gh-aw/release-data/docs_files.txt || echo \"No docs directory found\"\n\necho \"✓ Setup complete. Data available in /tmp/gh-aw/release-data/\"" + run: "set -e\nmkdir -p /tmp/gh-aw/release-data\n\n# Use the release ID and tag from the release job\necho \"Release ID from release job: $RELEASE_ID\"\necho \"Release tag from release job: $RELEASE_TAG\"\n\necho \"Processing release: $RELEASE_TAG\"\necho \"RELEASE_TAG=$RELEASE_TAG\" >> \"$GITHUB_ENV\"\n\n# Get the current release information\n# Use release ID to fetch release data\ngh api \"/repos/${{ github.repository }}/releases/$RELEASE_ID\" > /tmp/gh-aw/release-data/current_release.json\necho \"✓ Fetched current release information\"\n\n# Get the previous release to determine the range\nPREV_RELEASE_TAG=$(gh release list --limit 2 --json tagName --jq '.[1].tagName // empty')\n\nif [ -z \"$PREV_RELEASE_TAG\" ]; then\n echo \"No previous release found. This appears to be the first release.\"\n echo \"PREV_RELEASE_TAG=\" >> \"$GITHUB_ENV\"\n touch /tmp/gh-aw/release-data/pull_requests.json\n echo \"[]\" > /tmp/gh-aw/release-data/pull_requests.json\nelse\n echo \"Previous release: $PREV_RELEASE_TAG\"\n echo \"PREV_RELEASE_TAG=$PREV_RELEASE_TAG\" >> \"$GITHUB_ENV\"\n \n # Get commits between releases\n echo \"Fetching commits between $PREV_RELEASE_TAG and $RELEASE_TAG...\"\n git fetch --unshallow 2>/dev/null || git fetch --depth=1000\n \n # Get all merged PRs between the two releases\n echo \"Fetching pull requests merged between releases...\"\n PREV_PUBLISHED_AT=$(gh release view \"$PREV_RELEASE_TAG\" --json publishedAt --jq .publishedAt)\n CURR_PUBLISHED_AT=$(gh release view \"$RELEASE_TAG\" --json publishedAt --jq .publishedAt)\n gh pr list \\\n --state merged \\\n --limit 1000 \\\n --json number,title,author,labels,mergedAt,url,body \\\n --jq \"[.[] | select(.mergedAt >= \\\"$PREV_PUBLISHED_AT\\\" and .mergedAt <= \\\"$CURR_PUBLISHED_AT\\\")]\" \\\n > /tmp/gh-aw/release-data/pull_requests.json\n \n PR_COUNT=$(jq length \"/tmp/gh-aw/release-data/pull_requests.json\")\n echo \"✓ Fetched $PR_COUNT pull requests\"\nfi\n\n# Fetch community-labeled issues\necho \"Fetching issues with 'community' label...\"\nif ! gh issue list \\\n --label \"community\" \\\n --state all \\\n --limit 500 \\\n --json number,title,author,labels,closedAt,url \\\n > /tmp/gh-aw/release-data/community_issues.json; then\n echo \"[]\" > /tmp/gh-aw/release-data/community_issues.json\nfi\n\nCOMMUNITY_COUNT=$(jq length \"/tmp/gh-aw/release-data/community_issues.json\")\necho \"✓ Fetched $COMMUNITY_COUNT community-labeled issues\"\n\n# Get the CHANGELOG.md content around this version\nif [ -f \"CHANGELOG.md\" ]; then\n cp CHANGELOG.md /tmp/gh-aw/release-data/CHANGELOG.md\n echo \"✓ Copied CHANGELOG.md for reference\"\nfi\n\n# List documentation files for linking\nfind docs -type f -name \"*.md\" 2>/dev/null > /tmp/gh-aw/release-data/docs_files.txt || echo \"No docs directory found\"\n\necho \"✓ Setup complete. Data available in /tmp/gh-aw/release-data/\"" - name: Configure Git credentials env: diff --git a/.github/workflows/release.md b/.github/workflows/release.md index 9bbbd2f1677..64d61e0b261 100644 --- a/.github/workflows/release.md +++ b/.github/workflows/release.md @@ -356,6 +356,20 @@ steps: echo "✓ Fetched $PR_COUNT pull requests" fi + # Fetch community-labeled issues + echo "Fetching issues with 'community' label..." + if ! gh issue list \ + --label "community" \ + --state all \ + --limit 500 \ + --json number,title,author,labels,closedAt,url \ + > /tmp/gh-aw/release-data/community_issues.json; then + echo "[]" > /tmp/gh-aw/release-data/community_issues.json + fi + + COMMUNITY_COUNT=$(jq length "/tmp/gh-aw/release-data/community_issues.json") + echo "✓ Fetched $COMMUNITY_COUNT community-labeled issues" + # Get the CHANGELOG.md content around this version if [ -f "CHANGELOG.md" ]; then cp CHANGELOG.md /tmp/gh-aw/release-data/CHANGELOG.md @@ -379,6 +393,7 @@ Generate an engaging release highlights summary for **${{ github.repository }}** All data is pre-fetched in `/tmp/gh-aw/release-data/`: - `current_release.json` - Release metadata (tag, name, dates, existing body) - `pull_requests.json` - PRs merged between `${PREV_RELEASE_TAG}` and `${RELEASE_TAG}` (empty array if first release) +- `community_issues.json` - All issues labeled `community` (issue number, title, author, closedAt, url) - `CHANGELOG.md` - Full changelog for context (if exists) - `docs_files.txt` - Available documentation files for linking @@ -402,6 +417,9 @@ cat /tmp/gh-aw/release-data/current_release.json | jq # List PRs (empty if first release) cat /tmp/gh-aw/release-data/pull_requests.json | jq -r '.[] | "- #\(.number): \(.title) by @\(.author.login)"' +# List community issues +cat /tmp/gh-aw/release-data/community_issues.json | jq -r '.[] | "- #\(.number): \(.title) by @\(.author.login)"' + # Check CHANGELOG context head -100 /tmp/gh-aw/release-data/CHANGELOG.md 2>/dev/null || echo "No CHANGELOG" @@ -409,7 +427,21 @@ head -100 /tmp/gh-aw/release-data/CHANGELOG.md 2>/dev/null || echo "No CHANGELOG cat /tmp/gh-aw/release-data/docs_files.txt ``` -### 2. Categorize & Prioritize +### 2. Identify Community Contributions + +Cross-reference `community_issues.json` with `pull_requests.json` to find which community issues are resolved in this release. + +A community issue is considered resolved in this release if any PR in `pull_requests.json` references its number in the PR body (e.g., `Fixes #123`, `Closes #123`, `Resolves #123`). + +```bash +# Extract PR bodies and cross-reference with community issue numbers +cat /tmp/gh-aw/release-data/pull_requests.json | jq -r '.[].body // ""' | \ + grep -oP '(?i)(close[sd]?|fix(e[sd])?|resolve[sd]?)\s*#\K[0-9]+' | sort -u +``` + +For each community issue resolved in this release, note the **issue author** from `community_issues.json`. These are the community contributors to celebrate. + +### 3. Categorize & Prioritize Group PRs by category (omit categories with no items): - **✨ New Features** - User-facing capabilities @@ -419,7 +451,7 @@ Group PRs by category (omit categories with no items): - **⚠️ Breaking Changes** - Requires user action (ALWAYS list first if present) - **🔧 Internal** - Refactoring, dependencies (usually omit from highlights) -### 3. Write Highlights +### 4. Write Highlights Structure: ```markdown @@ -439,6 +471,12 @@ Structure: ### 📚 Documentation [Only if significant doc additions/improvements] +### 🌍 Community Contributions +[Only if any community-labeled issues are resolved in this release] +A huge thank you to the community members who reported issues that were resolved in this release: +- **@[author]** for [issue title] ([#number](url)) +[One entry per community issue author. Omit this section entirely if no community issues are resolved.] + --- For complete details, see [CHANGELOG](https://github.com/github/gh-aw/blob/main/CHANGELOG.md). ``` @@ -448,9 +486,9 @@ For complete details, see [CHANGELOG](https://github.com/github/gh-aw/blob/main/ - Be specific: "Reduced compilation time by 40%" not "Faster compilation" - Skip internal changes unless they have user impact - Use docs links: `[Learn more](https://github.github.com/gh-aw/path/)` -- Keep breaking changes prominent with action items +- Celebrate community contributors: thank each issue author by name with a link to their issue -### 4. Handle Special Cases +### 5. Handle Special Cases **First Release** (no `${PREV_RELEASE_TAG}`): ```markdown