Kaynağa Gözat

scripts: use github access token if available

Shiv Tyagi 10 ay önce
ebeveyn
işleme
b553b6b3b5
2 değiştirilmiş dosya ile 10 ekleme ve 0 silme
  1. 5 0
      scripts/fetch_releases.py
  2. 5 0
      scripts/fetch_whitelisted_tags.py

+ 5 - 0
scripts/fetch_releases.py

@@ -41,6 +41,11 @@ def fetch_tags_from_github():
         'X-GitHub-Api-Version': '2022-11-28',
         'Accept': 'application/vnd.github+json'
     }
+
+    token = os.getenv("CBS_GITHUB_ACCESS_TOKEN")
+    if token:
+        headers['Authorization'] = f"Bearer {token}"
+
     response = requests.get(url=url, headers=headers)
     if response.status_code != 200:
         print(response.text)

+ 5 - 0
scripts/fetch_whitelisted_tags.py

@@ -63,6 +63,11 @@ def fetch_tags_from_github(remote):
         'X-GitHub-Api-Version': '2022-11-28',
         'Accept': 'application/vnd.github+json'
     }
+
+    token = os.getenv("CBS_GITHUB_ACCESS_TOKEN")
+    if token:
+        headers['Authorization'] = f"Bearer {token}"
+
     response = requests.get(url=url, headers=headers)
     if response.status_code != 200:
         print(response.text)