From c831d1da915a4ac386554ff5ba2f73a8ff0d3da3 Mon Sep 17 00:00:00 2001
From: Tim Jaacks <tim.jaacks@garz-fricke.com>
Date: Tue, 27 Sep 2022 18:34:47 +0200
Subject: [PATCH] get_integration_sources: check if CI is enabled

Trying to query CI variables on a project which does not have the CI
feature enabled leads to an HTTP 403 (forbidden) error.
Check whether CI is enabled using the "jobs_enabled" flag.
---
 scripts/get_integration_sources.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/get_integration_sources.py b/scripts/get_integration_sources.py
index 4e069aea..e78916c7 100755
--- a/scripts/get_integration_sources.py
+++ b/scripts/get_integration_sources.py
@@ -27,7 +27,7 @@ def get_integration_sources(manifest_project: str, manifest_branch: str, group:
     for project in group.projects.list():
         try:
             project = gitlab.projects.get(project.id)
-            if not project.archived:
+            if not project.archived and project.jobs_enabled:
                 integrations = project.variables.get("INTEGRATION").value
                 for integration in integrations.splitlines():
                     if re.search(regex, integration):
-- 
GitLab