Merge pull request #30391 from andrewhsu/check-changelog-date

validate CHANGELOG.md dates are in descending order
(cherry picked from commit 5e74dc11e3)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Kenfe-Mickaël Laventure 2017-01-24 11:18:21 -08:00 committed by Sebastiaan van Stijn
parent 39781f92b3
commit 3804b6d408
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
2 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1,12 @@
#!/bin/bash
changelogFile=${1:-CHANGELOG.md}
if [ ! -r "$changelogFile" ]; then
echo "Unable to read file $changelogFile" >&2
exit 1
fi
grep -e '^## ' "$changelogFile" | awk '{print$3}' | sort -c -r || exit 2
echo "Congratulations! Changelog $changelogFile dates are in descending order."

View file

@ -15,3 +15,4 @@ export SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. $SCRIPTDIR/toml
. $SCRIPTDIR/vet
. $SCRIPTDIR/changelog-well-formed
. $SCRIPTDIR/changelog-date-descending