Skip to content

Commit 4e74c2e

Browse files
mvidalpinolJenkins CI
authored andcommitted
Check Changelog release version before committing release
1 parent bf377a4 commit 4e74c2e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scripts/commit_release.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ VERSION=$1
99
#NOTE: Ensure running in the repo root dir
1010
pushd $(dirname ${BASH_SOURCE[0]})/../ >/dev/null
1111

12+
CHANGELOG_VER=$(head -n1 Changelog.md | grep -oE "[0-9.]*(-rc[0-9]*)?")
13+
if [ "$CHANGELOG_VER" != "$VERSION" ] ; then
14+
echo -e "ERROR:\tThe changelog version does not match the release version"
15+
column -t -s ':' <<< "
16+
Changelog version: ${CHANGELOG_VER}
17+
Release version: ${VERSION}"
18+
exit
19+
fi
20+
1221
CHANGELOG_DIFF=$(git diff Changelog.md)
1322
if [ "x$CHANGELOG_DIFF" == "x" ]; then
1423
echo -e "ERROR:\tThe changelog does not contain the release changes"

0 commit comments

Comments
 (0)