-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from sam-berning/validate-changelog
actions: add CHANGELOG validation script
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Validate CHANGELOG | ||
on: | ||
pull_request: | ||
branches: [develop] | ||
paths: | ||
- 'CHANGELOG.md' | ||
|
||
jobs: | ||
validate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: ./tools/validate-changelog.sh |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
# check that all `# headers` are formatted as a version, e.g. v1.2.3 | ||
# this should be sufficient to validate the CHANGELOG for our CI, provided that | ||
# every new tag has a corresponding CHANGELOG update, as we always parse the | ||
# CHANGELOG between two headers with a tagged version. | ||
if diff <(grep -ne '^# ' CHANGELOG.md) <(grep -ne '^# v[0-9]\+\.[0-9]\+\.[0-9]\+' CHANGELOG.md); then | ||
echo "CHANGELOG validation PASSED!" | ||
else | ||
echo "CHANGELOG validation FAILED! Headers must match the regex '^# v[0-9]\+\.[0-9]\+\.[0-9]\+.'" | ||
exit 1 | ||
fi |