Skip to content

Better validate changelog #84

Better validate changelog

Better validate changelog #84

name: changelog-validator
on:
pull_request:
paths:
# Only run if changes were made to the changelog
- 'docs/changelog.md'
jobs:
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

Check failure on line 33 in .github/workflows/changelog-validator.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/changelog-validator.yml

Invalid workflow file

You have an error in your yaml syntax on line 33
with:
python-version: 3.11
- name: Install Markdown
run: python -m pip install .
- name: Get Markdown Version
id: markdown
run: echo "version=$(python -c 'import markdown; print(markdown.__version__)')" >> $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 }}