From 0d53f6f16955c8a30386e28c5d22d9e1ca28ab24 Mon Sep 17 00:00:00 2001 From: Sebb Date: Fri, 26 Sep 2025 10:45:44 +0100 Subject: [PATCH 1/2] Better hostname check Should not reject names such as "apache.organics.com" --- asfyaml/feature/website_publish.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asfyaml/feature/website_publish.py b/asfyaml/feature/website_publish.py index e9180c1..3ee4c83 100644 --- a/asfyaml/feature/website_publish.py +++ b/asfyaml/feature/website_publish.py @@ -58,7 +58,7 @@ def run(self): # Get optional target hostname: hostname = self.yaml.hostname if "hostname" in self.yaml else None - if hostname and "apache.org" in hostname: + if hostname and hostname.endswith(".apache.org"): if mappings.WS_HOSTNAME_OVERRIDES.get(self.repository.name, "") != hostname: raise Exception( f".asf.yaml: Invalid hostname '{hostname}' - you cannot specify *.apache.org hostnames, they must be inferred!" From 2d4facac115eb6ddc321d87b1ecf459d7c30588c Mon Sep 17 00:00:00 2001 From: Sebb Date: Fri, 26 Sep 2025 11:04:45 +0100 Subject: [PATCH 2/2] Fix Ruff complaint --- asfyaml/feature/github/branch_protection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asfyaml/feature/github/branch_protection.py b/asfyaml/feature/github/branch_protection.py index ec3d907..fe242a1 100644 --- a/asfyaml/feature/github/branch_protection.py +++ b/asfyaml/feature/github/branch_protection.py @@ -36,7 +36,7 @@ def _run_paged_graphql_query( variables = {"endCursor": end_cursor} variables.update(input_variables) - headers, data = self.ghrepo._requester.graphql_query(query, variables) + _headers, data = self.ghrepo._requester.graphql_query(query, variables) result = data["data"]["repository"]["refs"]["nodes"] for rule in result: