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:
parent
39781f92b3
commit
3804b6d408
2 changed files with 13 additions and 0 deletions
12
hack/validate/changelog-date-descending
Executable file
12
hack/validate/changelog-date-descending
Executable 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."
|
|
@ -15,3 +15,4 @@ export SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|||
. $SCRIPTDIR/toml
|
||||
. $SCRIPTDIR/vet
|
||||
. $SCRIPTDIR/changelog-well-formed
|
||||
. $SCRIPTDIR/changelog-date-descending
|
||||
|
|
Loading…
Reference in a new issue