A GitHub Action that checks for empty changelog entries in pull requests.
- Detects newly added changelog entries without content
- Adds a customizable label to PRs with empty changelog entries
- Provides detailed output about empty entries
- Adds customizable comments for warnings and success states
- Supports customization through inputs
- uses: babarot/changelog-empty-check-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
pull-request-number: ${{ github.event.pull_request.number }}
label-name: 'empty-changelog' # optional
warning-message: 'π¨ Empty changelog entries detected' # optional
success-message: 'β
Changelog entry has been filled' # optional| Name | Description | Required | Default |
|---|---|---|---|
github-token |
GitHub token for API operations | Yes | ${{ github.token }} |
pull-request-number |
Number of the pull request to check | Yes | N/A |
label-name |
Label to add when empty changelog is detected | No | empty-changelog |
warning-message |
Message to comment when empty changelog is detected | No | '' |
success-message |
Message to comment when changelog is filled | No | '' |
| Name | Description |
|---|---|
has_empty_changelog |
Whether empty changelog entries were found ('true' or 'false') |
empty_headers |
Newline-separated list of empty changelog headers |
name: Check Empty Changelog
on:
pull_request:
paths:
- 'CHANGELOG.md'
jobs:
check-changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: babarot/changelog-empty-check-action@v1
id: check
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
pull-request-number: ${{ github.event.pull_request.number }}
label-name: 'empty-changelog'
warning-message: 'π¨ Please add content to the empty changelog entries'
success-message: 'β
Thanks for updating the changelog!'Case 2: Use together with tagpr
jobs:
tagpr:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run tagpr
uses: Songmu/tagpr@v1.5.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: run-tagpr
- name: Check for empty changelog entries
if: steps.run-tagpr.outputs.pull_request != ''
uses: babarot/changelog-empty-check-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
label-name: changelog-missing
pull-request-number: ${{ fromJSON(steps.run-tagpr.outputs.pull_request).number }}- Clone the repository
- Install dependencies:
npm install - Make changes in
src/ - Run tests:
npm test - Build:
npm run build
MIT
Contributions are welcome! Please read our contributing guidelines and submit pull requests.
We use SemVer for versioning. For the versions available, see the tags on this repository.