Skip to content

Commit e115160

Browse files
added action to verify the changelog is updated (polkadot-fellows#153)
Added a GitHub action that uses [foodee/pr-includes-file-change](https://github.com/marketplace/actions/pr-includes-file-change) to fetch all the changes and verify that the file `CHANGELOG.md` has been modified. If it has not been modified and the PR body does not include the text `[x] Does not require a CHANGELOG entry`, the action will fail. This resolves polkadot-fellows#143 The template was updated to include a reminder on how to modify the changelog and instructions on how to skip the CI if the PR does not require to modify the changelog --------- Co-authored-by: fellowship-merge-bot[bot] <151052383+fellowship-merge-bot[bot]@users.noreply.github.com>
1 parent 1d8bdb2 commit e115160

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.github/pull_request_template.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
<!-- Remember that you can run `/merge` to enable auto-merge in the PR -->
2+
3+
<!-- Remember to modify the changelog. If you don't need to modify it, you can check the following box.
4+
Instead, if you have already modified it, simply delete the following line. -->
5+
6+
- [ ] Does not require a CHANGELOG entry

.github/workflows/changelog.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Modify Changelog
2+
3+
on:
4+
pull_request_target:
5+
6+
jobs:
7+
8+
verifyChangelogIsUpdated:
9+
runs-on: ubuntu-latest
10+
env:
11+
GITHUB_TOKEN: ${{ github.token }}
12+
steps:
13+
- name: Get Changed Files
14+
id: changed
15+
uses: foodee/pr-includes-file-change@master
16+
with:
17+
paths: ^CHANGELOG.md
18+
- name: Set error
19+
if: steps.changed.outputs.matched != 'true' && !contains(github.event.pull_request.body, '[x] Does not require a CHANGELOG entry')
20+
run: echo "::error::CHANGELOG.md has not been modified. Either modify the file or check the checkbox in the body" && exit 1

0 commit comments

Comments
 (0)