github: require release notes for pull requests

This commit is contained in:
Slyghtning 2026-08-03 11:17:54 +02:00
parent a8e3e9c853
commit 414760c607
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF
3 changed files with 41 additions and 2 deletions

View file

@ -1,3 +1,3 @@
#### Pull Request Checklist
- [ ] Update `docs/release-notes/release-notes-next.md` if your PR contains
major features, breaking changes or bugfixes
- [ ] Add an entry to `docs/release-notes/release-notes-next.md` (required by
CI)

View file

@ -24,6 +24,42 @@ env:
LITD_ITEST_BRANCH: master
jobs:
########################
# release notes
########################
release-notes:
name: Release Notes
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for a release note
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
RELEASE_NOTES_FILE: docs/release-notes/release-notes-next.md
run: |
if git diff --unified=0 "$BASE_SHA...$HEAD_SHA" -- \
"$RELEASE_NOTES_FILE" |
awk '
/^@@/ { in_hunk = 1; next }
in_hunk && /^\+/ {
line = substr($0, 2)
if (line ~ /[^[:space:]]/) found = 1
}
END { exit found ? 0 : 1 }
'
then
exit 0
fi
echo "::error file=$RELEASE_NOTES_FILE::Add a release note for this PR."
exit 1
########################
# commit message lint
########################

View file

@ -13,4 +13,7 @@
#### Maintenance
* Added a CI gate requiring every pull request to include a non-empty entry in
the next release notes.
#### Contributors (Alphabetical Order)