mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-23 11:34:09 +01:00
Validate input of generate-changelog script
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
parent
a34a89a073
commit
54aed4d260
|
|
@ -8,13 +8,10 @@ set -e
|
||||||
VERSION="$1"
|
VERSION="$1"
|
||||||
DATE="$2"
|
DATE="$2"
|
||||||
|
|
||||||
cd `dirname $0`/../changelogs
|
if [ -z "$VERSION" ]; then
|
||||||
|
echo "ERROR: The version of the changelog must be provided"
|
||||||
# Pre-cleanup just in case it wasn't done on the last run
|
exit 1
|
||||||
rm -f rendered.md
|
fi
|
||||||
|
|
||||||
# Generate changelog
|
|
||||||
towncrier --yes
|
|
||||||
|
|
||||||
if [ "$VERSION" = "vUNSTABLE" ]; then
|
if [ "$VERSION" = "vUNSTABLE" ]; then
|
||||||
TITLE="Changes since last release"
|
TITLE="Changes since last release"
|
||||||
|
|
@ -25,8 +22,26 @@ else
|
||||||
TITLE="$VERSION Changelog"
|
TITLE="$VERSION Changelog"
|
||||||
LINKTITLE="$VERSION"
|
LINKTITLE="$VERSION"
|
||||||
FILENAME="$VERSION.md"
|
FILENAME="$VERSION.md"
|
||||||
|
|
||||||
|
if [ -z "$DATE" ]; then
|
||||||
|
echo "ERROR: The date of the release must be provided for stable releases"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! "$DATE" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then
|
||||||
|
echo "ERROR: The date does not have the format YYYY-MM-DD"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cd `dirname $0`/../changelogs
|
||||||
|
|
||||||
|
# Pre-cleanup just in case it wasn't done on the last run
|
||||||
|
rm -f rendered.md
|
||||||
|
|
||||||
|
# Generate changelog
|
||||||
|
towncrier --yes
|
||||||
|
|
||||||
{
|
{
|
||||||
# Prepare the header
|
# Prepare the header
|
||||||
# We include the generation date in the front matter so that we can use it
|
# We include the generation date in the front matter so that we can use it
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue