Commit afb8ed03 authored by Jan Kiene's avatar Jan Kiene
Browse files

fix printout and if statement

parent df2e94bc
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ stages:
  - commits_behind_count=$(git rev-list --count $CI_COMMIT_SHA..origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME)

.check-commits-behind-count-in-compare-jobs: &check-commits-behind-count-in-compare-jobs
  - 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 -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 merge origin/main` to update."; exit 1; fi

# ---------------------------------------------------------------
# Job templates
@@ -257,7 +257,7 @@ branch-is-up-to-date-with-main-pre:
  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, 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 merge origin/main` to update."; exit 1; fi;

branch-is-up-to-date-with-main-post:
  extends:
@@ -268,7 +268,7 @@ branch-is-up-to-date-with-main-post:
  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;
    - 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 merge origin/main` to update." exit 1; fi;

# ---------------------------------------------------------------
# Build jobs