Skip to content

Commit fe9b3d6

Browse files
kompreclaude
andcommitted
Improve GitHub Release notes with PR details
Changes: - Pass PR number through job outputs to release creation step - Fetch PR title and body from GitHub API - Use PR content as release notes (no more fake CHANGELOG reference) - Add installation instructions using pipx (recommended method) - Include links to package (PyPI/TestPyPI), PR, and documentation - Update RELEASE.md to mention PR body becomes release notes Release notes now include: - PR title and description - Installation: pipx install quarto-batch-convert - Links to package, PR, and docs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a7d2881 commit fe9b3d6

2 files changed

Lines changed: 39 additions & 7 deletions

File tree

.github/RELEASE.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ After merge:
3838
- Package is built and tested
3939
- Published to PyPI or TestPyPI
4040
- Git tag created (e.g., `v2025.9.0`)
41-
- GitHub Release created
41+
- GitHub Release created with:
42+
- PR title and body as release notes
43+
- Installation instructions (`pipx install quarto-batch-convert`)
44+
- Links to package, PR, and documentation
45+
46+
**Tip**: Write a clear PR description - it will become your release notes!
4247

4348
## Example: Patch Release to PyPI
4449

.github/workflows/release.yml

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
outputs:
1717
should-release: ${{ steps.check.outputs.release }}
1818
is-test: ${{ steps.check.outputs.test }}
19+
pr-number: ${{ steps.check.outputs.pr_number }}
1920
steps:
2021
- name: Checkout repository
2122
uses: actions/checkout@v4
@@ -59,6 +60,9 @@ jobs:
5960
echo "test=false" >> $GITHUB_OUTPUT
6061
fi
6162
63+
# Export PR number for later jobs
64+
echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT
65+
6266
build:
6367
needs: check-release-label
6468
if: needs.check-release-label.outputs.should-release == 'true'
@@ -186,15 +190,38 @@ jobs:
186190
env:
187191
GH_TOKEN: ${{ github.token }}
188192
VERSION: ${{ needs.build.outputs.version }}
193+
PR_NUMBER: ${{ needs.check-release-label.outputs.pr-number }}
189194
run: |
190-
RELEASE_TYPE="${{ needs.check-release-label.outputs.is-test == 'true' && 'test' || 'production' }}"
195+
RELEASE_TYPE="${{ needs.check-release-label.outputs.is-test == 'true' && 'TestPyPI' || 'PyPI' }}"
196+
PACKAGE_URL="${{ needs.check-release-label.outputs.is-test == 'true' && 'https://test.pypi.org/project/quarto-batch-convert' || 'https://pypi.org/project/quarto-batch-convert' }}"
191197
192-
gh release create "v${VERSION}" \
193-
--title "v${VERSION}" \
194-
--notes "Release v${VERSION} (${RELEASE_TYPE})
198+
# Fetch PR details
199+
PR_TITLE=$(gh pr view $PR_NUMBER --json title --jq '.title')
200+
PR_BODY=$(gh pr view $PR_NUMBER --json body --jq '.body')
201+
PR_URL="https://github.com/${{ github.repository }}/pull/$PR_NUMBER"
202+
203+
# Build release notes
204+
RELEASE_NOTES="## ${PR_TITLE}
205+
206+
${PR_BODY}
207+
208+
---
195209
196-
Published from PR #${{ github.event.pull_request.number }}
210+
## Installation
197211
198-
See [CHANGELOG](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details." \
212+
\`\`\`bash
213+
pipx install quarto-batch-convert
214+
\`\`\`
215+
216+
## Links
217+
218+
- 📦 Package: [${RELEASE_TYPE}](${PACKAGE_URL})
219+
- 🔗 Pull Request: [#${PR_NUMBER}](${PR_URL})
220+
- 📚 Documentation: [README](https://github.com/${{ github.repository }}/blob/main/README.md)
221+
"
222+
223+
gh release create "v${VERSION}" \
224+
--title "v${VERSION}" \
225+
--notes "$RELEASE_NOTES" \
199226
--draft=false \
200227
--prerelease=${{ needs.check-release-label.outputs.is-test == 'true' }}

0 commit comments

Comments
 (0)