Created
September 9, 2022 04:53
-
-
Save vi7/f1288666c731d9b3ce1421ca564c4433 to your computer and use it in GitHub Desktop.
Script to check if app version has been bumped. To be used with Merge Request CI checks
This file contains hidden or 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
#!/usr/bin/env sh | |
# Script to check if app version has been bumped | |
# To be used with Merge Request CI checks | |
set -e | |
VERSION_FILE="ci/build.env" | |
git fetch origin | |
if ! git diff --unified=0 origin/master.. -- $VERSION_FILE | grep '^[+-]' | grep -i "version" >/dev/null | |
then | |
printf 'Version check \e[1;31mFAILED!! \e[0mBump the version and update your branch\n' | |
exit 1 | |
else | |
printf 'Version check \e[1;32mPASSED\e[0m\n' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment