How to Draft Release Notes From Merged PRs
release-drafter accumulates merged PRs into a draft release, categorized by label, and updates it on each merge to main.
Run release-drafter/release-drafter@v6 on pushes to the default branch. It reads .github/release-drafter.yml for categories and version rules and maintains a single draft release you publish when ready.
Steps
- Add
.github/release-drafter.ymlwith categories and a template. - Run
release-drafter/release-drafter@v6on push to main. - Grant
contents: writeandpull-requests: read.
Workflow
.github/workflows/ci.yml
on:
push:
branches: [main]
permissions:
contents: write
pull-requests: read
jobs:
draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}release-drafter config
.github/release-drafter.yml
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: 'Features'
labels: ['feature', 'enhancement']
- title: 'Bug Fixes'
labels: ['fix', 'bug']
version-resolver:
minor:
labels: ['feature']
default: patch
template: |
## Changes
$CHANGESGotchas
- Version resolution depends on PR labels; unlabeled PRs fall to the default bump.
- The draft is not published automatically; add
publish: trueonly for tag-triggered runs.
Related guides
How to Enforce a Semantic Squash-Merge TitleKeep a clean default branch history by validating the PR title (which becomes the squash commit) against Conv…
How to Require Conventional Commit PR TitlesEnforce a Conventional Commits format on pull request titles with amannn/action-semantic-pull-request, failin…