From 2b5108835123418348bd4c2d240949bd80402389 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Oto=20=C5=A0=C5=A5=C3=A1va?= <oto.stava@nic.cz>
Date: Wed, 13 Jul 2022 08:21:48 +0200
Subject: [PATCH] ci: confine docker and macOS jobs to main repository

Some of our CI jobs use project-specific GitLab runners (e.g. requiring
the `dind` tag). The jobs then fail when someone forks the repository
and opens a merge request. This commit confines those jobs to the
`knot/knot-resolver` repository.
---
 .gitlab-ci.yml | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 43313f0b7..be79367a3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -27,7 +27,6 @@ stages:
   - deploy
   - pkgtest
 
-
  # https://docs.gitlab.com/ce/ci/jobs/job_control.html#select-different-runner-tags-for-each-parallel-matrix-job
 .multi_platform: &multi_platform
   parallel:
@@ -115,9 +114,9 @@ build-asan:
 
 build:macOS:
   <<: *nodep
-  except:
+  only:
     refs:
-      - branches@knot/security/knot-resolver
+      - branches@knot/knot-resolver
   stage: build
   when: delayed
   start_in: 3 minutes  # allow some time for mirroring, job creation
@@ -129,6 +128,9 @@ docker:
   stage: build
   image: docker:latest
   <<: *multi_platform
+  only:
+    refs:
+      - branches@knot/knot-resolver
   tags:
     - ${PLATFORM}
     - dind
@@ -356,6 +358,9 @@ pkgtest:
 pytests:
   # these are executed on LXC runners to increase stability
   image: $CI_REGISTRY/knot/knot-resolver/ci/lxc-debian-11:knot-$KNOT_VERSION
+  only:
+    refs:
+      - branches@knot/knot-resolver
   needs: []
   tags:
     - lxc
-- 
GitLab