Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
## πŸ§ͺ How to test?
> How to test the changes added?
## 🧾 Changelog
> Add an entry to `CHANGELOG.md`. If this PR has no customer facing changes, write "No customer facing changes" here to skip the changelog check.
## πŸ“Ή Loom recording if applicable
> If it helps the reviewer, add a short Loom going over the changes or showcasing the change in behavior.
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/changelog-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Changelog Check
on:
pull_request:
types: [opened, edited, synchronize, reopened]

permissions:
contents: read
pull-requests: read

jobs:
changelog:
name: Verify CHANGELOG update
runs-on: ubuntu-latest
steps:
- name: Check CHANGELOG.md update or opt-out
uses: actions/github-script@v7
with:
script: |
const optOut = 'No customer facing changes';
const body = context.payload.pull_request.body || '';

if (body.toLowerCase().includes(optOut.toLowerCase())) {
core.info(`PR description contains "${optOut}", skipping CHANGELOG.md check.`);
return;
}

const files = await github.paginate(github.rest.pulls.listFiles, {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
per_page: 100,
});

const changed = files.some((f) => f.filename === 'CHANGELOG.md');
if (changed) {
core.info('CHANGELOG.md was updated.');
return;
}

core.setFailed(
'CHANGELOG.md was not updated. Add a CHANGELOG.md entry, or if this PR has no customer facing changes, add "No customer facing changes" to the PR description to justify skipping the changelog.'
);
Loading