Better validate changelog #80
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: changelog-validator | |
on: | |
pull_request: | |
paths: | |
# Only run if changes were made to the changelog | |
- 'docs/changelog.md' | |
jobs: | |
validate: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Validate Changelog | |
id: changelog_reader | |
uses: mindsers/changelog-reader-action@v2 | |
with: | |
validation_level: error | |
path: docs/changelog.md | |
- name: Validate Latest Version is a Release | |
id: validate_release_version | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'release') && steps.changelog_reader.outputs.status != 'unreleased' }} | |
run: echo "This PR is labeled as a release and the latest version in Changleog is ${{ steps.changelog_reader.outputs.version }}." | |
- name: Validate Latest Version is not a Release | |
id: validate_not_release_version | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'release') && steps.changelog_reader.outputs.status == 'unreleased' }} | |
run: | | |
echo "This PR is labeled as a release but the latest version in Changleog has status 'unreleased'." | |
exit 1 | |