diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f1c4fdd..7b252af 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,3 +11,5 @@ mirror: stage: triggers trigger: include: .gitlab/mirror.yml + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH diff --git a/.gitlab/mirror.yml b/.gitlab/mirror.yml index d99cafc..86a4021 100644 --- a/.gitlab/mirror.yml +++ b/.gitlab/mirror.yml @@ -17,8 +17,10 @@ pull-github: script: - whoami; env + - if [ -z "$CI_COMMIT_BRANCH" ]; then echo "Not on a branch" >&2; exit 3; fi + - git remote remove github 2>/dev/null || true - git remote add github https://github.com/qurator-spk/dinglehopper.git - git remote -v - - git pull github master + - git pull github "$CI_COMMIT_BRANCH"