Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

Commit d93ee89

Browse files
committed
add changelog check
1 parent cb6460c commit d93ee89

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Changelog Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
check-changelog:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Check for changelog entry
16+
id: changelog-check
17+
run: |
18+
# Get the files changed in this PR
19+
git fetch origin ${{ github.base_ref }}
20+
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD)
21+
22+
# Check if docs/pages/resources/changelog.md was modified
23+
if echo "$CHANGED_FILES" | grep -q "docs/pages/resources/changelog.md"; then
24+
echo "Changelog was modified ✅"
25+
echo "has_changelog=true" >> $GITHUB_OUTPUT
26+
else
27+
echo "No changelog entry found ❌"
28+
echo "has_changelog=false" >> $GITHUB_OUTPUT
29+
fi
30+
31+
- name: Comment on PR
32+
if: steps.changelog-check.outputs.has_changelog == 'false'
33+
uses: actions/github-script@v7
34+
with:
35+
script: |
36+
github.rest.issues.createComment({
37+
issue_number: context.issue.number,
38+
owner: context.repo.owner,
39+
repo: context.repo.name,
40+
body: '⚠️ This PR is missing a changelog entry. Please add an entry to `docs/pages/resources/changelog.md` describing your changes.'
41+
})

0 commit comments

Comments
 (0)