Commit 06eae2c9 authored by Fabian Müller's avatar Fabian Müller
Browse files

Extract check-commits-behind-count-in-compare-jobs snippet

parent 344fcdaa
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
#! /bin/bash

set -euo pipefail

cd "${CI_PROJECT_DIR}"

commits_behind_count="$(bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/get-commits-behind-count.sh)"

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."
    ECHO "Main might have changed during your pipeline run. Run 'git merge origin/main' to update."
    exit 1
fi