Skip to content

Commit c9df8e6

Browse files
committed
Emit a warning if a PR does not update the changelog
1 parent 187ad22 commit c9df8e6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/pr-checks.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PR Checks
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
7+
jobs:
8+
changelog-check:
9+
name: Check CHANGELOG.md
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out code
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 2
16+
17+
- name: Check for CHANGELOG.md edits and comment if missing
18+
run: |
19+
if ! git diff --name-only HEAD^1 HEAD | grep -q 'CHANGELOG.md'; then
20+
gh pr comment ${{ github.event.pull_request.number }} --body "⚠️ Warning: Please update CHANGELOG.md with your changes."
21+
fi
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)