Skip to content

Commit 5b81927

Browse files
committed
gha: enforce CHANGELOG.md entries for PRs
Each release requires going through the list of PRs and trying to parse out what a reasonable changelog entry is (possibly ~6 months after the patch was last discussed and merged), which makes preparing release notes quite time-consuming. Given that the moment when the patch is merged is when the information about the imapct of a patch is most apparent to the author and reviewers, it seems prudent to require that every PR have a CHANGELOG.md change. Trivial patches can just add a dummy entry in the changelog (in future, we can expand this script to skip over commits that have some special tag to avoid the need for dummy entries). Signed-off-by: Aleksa Sarai <[email protected]>
1 parent 52c3a0e commit 5b81927

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/changelog.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: changelog
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
check:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v6
10+
with:
11+
fetch-depth: 0
12+
- name: git fetch ${{ github.ref }}
13+
run: |-
14+
git fetch origin ${{ github.ref }}
15+
git tag GITHUB_REF FETCH_HEAD
16+
- name: git fetch ${{ github.base_ref }}
17+
run: |-
18+
git fetch origin ${{ github.base_ref }}
19+
git tag GITHUB_BASE_REF FETCH_HEAD
20+
- name: check that CHANGELOG.md has an entry
21+
run: >-
22+
git diff --name-only GITHUB_BASE_REF...GITHUB_REF \
23+
| grep CHANGELOG.md \
24+
|| { echo "Every PR must have a CHANGELOG.md change."; exit 1; }

0 commit comments

Comments
 (0)