77 - ' docs/changelog.md'
88
99jobs :
10- validate :
11-
10+ validate-unreleased :
11+ # Validates changelog and confirms that an Unreleased entry exists.
12+ # Only run when the `release` label is not set on a PR.
13+ if : ${{ ! contains(github.event.pull_request.labels.*.name, 'release') }}
1214 runs-on : ubuntu-latest
1315 steps :
1416 - uses : actions/checkout@v4
@@ -18,14 +20,28 @@ jobs:
1820 with :
1921 validation_level : error
2022 path : docs/changelog.md
21- - name : Validate Latest Version is a Release
22- id : validate_release_version
23- if : ${{ contains(github.event.pull_request.labels.*.name, 'release') && steps.changelog_reader.outputs.status != 'unreleased' }}
24- run : echo "This PR is labeled as a release and the latest version in Changleog is ${{ steps.changelog_reader.outputs.version }}."
25- - name : Validate Latest Version is not a Release
26- id : validate_not_release_version
27- if : ${{ contains(github.event.pull_request.labels.*.name, 'release') && steps.changelog_reader.outputs.status == 'unreleased' }}
28- run : |
29- echo "This PR is labeled as a release but the latest version in Changleog has status 'unreleased'."
30- exit 1
23+ version : Unreleased
3124
25+ validate-release :
26+ # Validates changelog and confirms an entry exists for version in code.
27+ # Only run when the `release` label is set on a PR.
28+ if : ${{ contains(github.event.pull_request.labels.*.name, 'release') }}
29+ runs-on : ubuntu-latest
30+ steps :
31+ - uses : actions/checkout@v4
32+ - name : Setup Python
33+ uses : actions/setup-python@v4
34+ with :
35+ python-version : 3.11
36+ - name : Install Markdown
37+ run : python -m pip install .
38+ - name : Get Markdown Version
39+ id : markdown
40+ run : echo "version=$(python -c 'import markdown; print(markdown.__version__)')" >> $GITHUB_OUTPUT
41+ - name : Validate Changelog
42+ id : changelog_reader
43+ uses : mindsers/changelog-reader-action@v2
44+ with :
45+ validation_level : error
46+ path : docs/changelog.md
47+ version : ${{ steps.markdown.outputs.version }}
0 commit comments