Commit a984e260 authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Implement check for validating that branch is up to date.

parent 3055ca9e
Loading
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ workflow:

stages:
  - maintenance
  - validate
  - build
  - test
  - compare
@@ -105,6 +106,21 @@ stages:
      - 123


# ---------------------------------------------------------------
# Validation jobs
# ---------------------------------------------------------------

check-if-branch-is-up-to-date-with-main:
  extends:
    - .rules-merge-request
  stage: validate
  tags:
    - ivas-linux
  script:
    - commits_behind_count=$(git rev-list --count $CI_COMMIT_SHA..$CI_MERGE_REQUEST_TARGET_BRANCH_NAME)
    - [ $commits_behind_count -eq 0 ]


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