From 9c14d965dba43f59a4cfce38f983897bab69fad2 Mon Sep 17 00:00:00 2001 From: DragonSlayer_14 Date: Thu, 10 Sep 2026 23:21:29 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20Zus=C3=A4tzliche=20Pr=C3=BCfung=20auf=20?= =?UTF-8?q?leere=20Umgebungsvariablen=20in=20report-security-issue.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/report-security-issue.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/report-security-issue.py b/scripts/report-security-issue.py index 5641d7e..1518b86 100644 --- a/scripts/report-security-issue.py +++ b/scripts/report-security-issue.py @@ -253,8 +253,8 @@ def main(): osv_path = sys.argv[2] if len(sys.argv) > 2 else None trufflehog_path = sys.argv[3] if len(sys.argv) > 3 else None - gitea_url = os.environ.get("GITEA_URL", "").rstrip("/") - repo = os.environ.get("REPO", "") + gitea_url = os.environ.get("GITEA_URL", "").strip().rstrip("/") + repo = os.environ.get("REPO", "").strip() token = os.environ.get("TOKEN", "").strip() run_url = os.environ.get("RUN_URL", "") osv_exit = int(os.environ.get("OSV_EXIT", "0")) @@ -263,8 +263,9 @@ def main(): findings = sort_findings(load_trivy(trivy_path) + load_osv(osv_path) + load_trufflehog(trufflehog_path)) print_summary(findings) - if not token: - print("TOKEN nicht gesetzt oder leer – überspringe Gitea-Issue-Synchronisation.") + if not token or not gitea_url or not repo: + missing = [name for name, val in [("TOKEN", token), ("GITEA_URL", gitea_url), ("REPO", repo)] if not val] + print(f"{', '.join(missing)} nicht gesetzt oder leer – überspringe Gitea-Issue-Synchronisation.") else: open_issue = find_open_issue(token, gitea_url, repo)