From: Ilya Shipitsin Date: Thu, 22 Dec 2022 16:27:37 +0000 (+0600) Subject: CI: github: enable github api authentication for OpenSSL tags read X-Git-Tag: v2.8-dev1~66 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=6fbc35f4739040a0da6150e27a2b6e7e41bf4045;p=thirdparty%2Fhaproxy.git CI: github: enable github api authentication for OpenSSL tags read github api throttles requests with no auth, thus we can enable GITHUB_API_TOKEN env variable. if not set, current behaviour is kept --- diff --git a/.github/matrix.py b/.github/matrix.py index ffc3414b95..72e6b1a852 100755 --- a/.github/matrix.py +++ b/.github/matrix.py @@ -26,7 +26,9 @@ def clean_ssl(ssl): return ssl.replace("_VERSION", "").lower() def determine_latest_openssl(ssl): - openssl_tags = urllib.request.urlopen("https://api.github.com/repos/openssl/openssl/tags") + headers = {'Authorization': 'token ' + environ.get('GITHUB_API_TOKEN')} if environ.get('GITHUB_API_TOKEN') else {} + request = urllib.request.Request('https://api.github.com/repos/openssl/openssl/tags', headers=headers) + openssl_tags = urllib.request.urlopen(request) tags = json.loads(openssl_tags.read().decode('utf-8')) latest_tag = '' for tag in tags: