diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9529be0e3cdb8d5d3ff6aaa5152a8b0826164687..0b2b3ddff9e5a94a176be61202901490412ab75b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,6 +25,7 @@ stages: - build - test - compare + - validate # --------------------------------------------------------------- # Generic script anchors @@ -107,6 +108,25 @@ stages: - 123 +# --------------------------------------------------------------- +# Validation jobs +# --------------------------------------------------------------- + +check-if-branch-is-up-to-date-with-main: + extends: + - .rules-merge-request + stage: validate + needs: [] + tags: + - ivas-linux + script: + - echo $CI_COMMIT_SHA + - echo $CI_MERGE_REQUEST_TARGET_BRANCH_NAME + - commits_behind_count=$(git rev-list --count $CI_COMMIT_SHA..origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME) + - echo $commits_behind_count + - if [ $commits_behind_count -eq 0 ]; then exit 0; else exit 1; fi; + + # --------------------------------------------------------------- # Build jobs # ---------------------------------------------------------------