Skip to content

Instantly share code, notes, and snippets.

@vi7
Created September 9, 2022 04:53
Show Gist options
  • Save vi7/f1288666c731d9b3ce1421ca564c4433 to your computer and use it in GitHub Desktop.
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
#!/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