This GitHub Action will check whether a PR also modifies the projects changelog. This is useful to ensure that each change committed comes with an user-readable explanation.
It doesn't check the format of the changelog but is still meant as a reminder to add a change so the contents of the change itself can be discussed in the review.
- Create a PR with some changes
- See the action fail your build because the changelog wasn't modified
- Add an entry in changelog and push
- See the action succeed.
Not all changes need a changelog entry, some are not user-visible, like changing CI or some internal refactoring. For those it is possible to disable the check.
To do so, create a new label called no changelog and apply it to the PR. Then the changelog check will re-run and succeed automatically. This label can also be applied directly when opening the PR so the check will be automatically omitted.
The file that is being checked by default is called CHANGES.md but you can use the changelog argument to specify any other file as well.
First, set up the action in .github/workflows/<your-file>.yml.
Add this to your GitHub workflow:
- name: Check changelog uses: tarides/changelog-check-action@v2A complete .github/workflows/changelog.yml might look like this:
name: Check Changelog on: pull_request: types: [assigned, opened, synchronize, reopened, labeled, unlabeled] branches: - main jobs: Check-Changelog: name: Check Changelog Action runs-on: ubuntu-20.04 steps: - uses: tarides/changelog-check-action@v2 with: changelog: CHANGES.md