From: Marc Foley Date: Mon, 19 Feb 2024 15:09:41 +0000 (+0000) Subject: Implement Rod feedback X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db9758903faed3a87f07a8a3d7f6cb7de7780ee7;p=thirdparty%2Fgoogle%2Ffonts.git Implement Rod feedback --- diff --git a/.github/workflows/knowledge_graph.py b/.github/workflows/knowledge_graph.py index c89cb4fa38..569fa62798 100644 --- a/.github/workflows/knowledge_graph.py +++ b/.github/workflows/knowledge_graph.py @@ -192,18 +192,18 @@ def _check_md_file_contents(repo_root: Path, md_file: Path, ast: List[MdValue]) def _check_outbound_link(url: str): # Following urls work correctly on a web browser but 404 when using python requests whitelist = frozenset(["https://www.jessicahische.is/talkingtype"]) - if url in whitelist: + # Following urls will be fixed at a later date. If the CI is failing and a suitable + # replacement url cannot be found, please add them to this set. + to_fix = frozenset() + if url in whitelist | to_fix: return True - try: - url_status_code = requests.get(url).status_code - except requests.exceptions.SSLError: - print(f"INVALID SSL '{url}'") - # The url does exist but the cert is expired. I'm going to claim this is ok. - return True - if url_status_code == 404: - print(f"INVALID url '{url}' returned response status code '{url_status_code}'") + response = requests.get(url, allow_redirects=True) + if response.status_code == 404: + print(f"INVALID url '{url}' returned response status code '{response.status_code}'") return False + elif response.status_code == 495: + print(f"INVALID SSL '{url}'") return True