-if [ $commits_behind_count -ne 0 ]; then echo "Your branch is not up-to-date with main -> Compare tests will not run as they can contain false negatives this way.\nMain might have changed during your pipeline run. Run `git pull origin/main` to update."; exit 1; fi;
-if [ $commits_behind_count -eq 0 ]; then exit 0; else echo "Your branch is behind main, run `git pull origin/main` to update."; exit 1; fi;
branch-is-up-to-date-with-main-post:
extends:
-.rules-merge-request
stage:postvalidate
tags:
-ivas-linux
script:
-*get-commits-behind-count
-echo $commits_behind_count
-if [ $commits_behind_count -eq 0 ]; then exit 0; else echo "Your branch is behind main, possibly main changed during your pipeline run, run `git pull origin/main` to update." exit 1; fi;