diff --git a/.github/matrix.py b/.github/matrix.py index a2a02e968..7f22c43bb 100755 --- a/.github/matrix.py +++ b/.github/matrix.py @@ -33,11 +33,13 @@ def determine_latest_openssl(ssl): headers = {} if environ.get("GITHUB_TOKEN") is not None: headers["Authorization"] = "token {}".format(environ.get("GITHUB_TOKEN")) - request = urllib.request.Request( "https://api.github.com/repos/openssl/openssl/tags", headers=headers ) - openssl_tags = urllib.request.urlopen(request) + try: + openssl_tags = urllib.request.urlopen(request) + except: + return "OPENSSL_VERSION=failed_to_detect" tags = json.loads(openssl_tags.read().decode("utf-8")) latest_tag = "" for tag in tags: @@ -50,9 +52,12 @@ def determine_latest_openssl(ssl): @functools.lru_cache(5) def determine_latest_libressl(ssl): - libressl_download_list = urllib.request.urlopen( - "https://cdn.openbsd.org/pub/OpenBSD/LibreSSL/" - ) + try: + libressl_download_list = urllib.request.urlopen( + "https://cdn.openbsd.org/pub/OpenBSD/LibreSSL/" + ) + except: + return "LIBRESSL_VERSION=failed_to_detect" for line in libressl_download_list.readlines(): decoded_line = line.decode("utf-8") if "libressl-" in decoded_line and ".tar.gz.asc" in decoded_line: