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)