Skip to content

Commit

Permalink
tools: Ignore gnome.org in urls-check
Browse files Browse the repository at this point in the history
https://gnome.org keeps failing with "403 Forbidden" when running in a
GitHub action, presumably due to some IP range (or User-Agent) ban? It
works fine locally.

We know that https://www.gnome.org is fine, so generalize our existing
ignore mechanism for example.com and add it to that list.

Fixes #21340
  • Loading branch information
martinpitt committed Nov 28, 2024
1 parent 7090fab commit 52d1c41
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tools/urls-check
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ TASK_NAME = "Validate all URLs"

USER_AGENT = "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0"

IGNORE = [
"https://www.gnome.org", # keeps causing 403 from GitHub; DNS or user-agent ban?
"*example.com*", # some tests use demo urls
]

KNOWN_REDIRECTS = [
# fnmatch-like
"https://access.redhat.com/security/updates/classification/#",
Expand Down Expand Up @@ -113,7 +118,9 @@ def check_urls(verbose):
if not url:
continue

if urllib.parse.urlparse(url).hostname.endswith(".example.com"): # Some tests use demo urls
if any(fnmatch.fnmatch(url, pattern) for pattern in IGNORE):
if verbose:
print(f"Ignoring: {url}")
continue

if verbose:
Expand Down

0 comments on commit 52d1c41

Please sign in to comment.