Skip to content
Merged
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
29 changes: 28 additions & 1 deletion .github/workflows/changelog-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,41 @@ on:
- 'docs/changelog.md'

jobs:
validate:
validate-unreleased:
# Validates changelog and confirms that an Unreleased entry exists.
# Only run when the `release` label is not set on a PR.
if: ${{ ! contains(github.event.pull_request.labels.*.name, 'release') }}
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
version: Unreleased

validate-release:
# Validates changelog and confirms an entry exists for version in code.
# Only run when the `release` label is set on a PR.
if: ${{ contains(github.event.pull_request.labels.*.name, 'release') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Markdown
run: python -m pip install semver .
- name: Get Markdown Version
id: markdown
run: echo "version=$(python -c 'import markdown, semver; print(semver.Version.parse(markdown.__version__, optional_minor_and_patch=True))')" >> $GITHUB_OUTPUT
- name: Validate Changelog
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
validation_level: error
path: docs/changelog.md
version: ${{ steps.markdown.outputs.version }}
Loading