Skip to content

Commit

Permalink
build: try to use GITHUB_TOKEN
Browse files Browse the repository at this point in the history
  • Loading branch information
Alystrasz committed Jan 25, 2024
1 parent 0c90f5a commit 2c5b6e1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/verify_versions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import sys
import unittest
from urllib.request import urlopen
from urllib.request import Request, urlopen
import json

def verify_all_mod_versions():
Expand Down Expand Up @@ -52,7 +53,13 @@ def retrieve_tag_info(tag_name, repository_url):
i = 1
while True:
url = '{}?page={}'.format(repository_url, i)
response = urlopen(url)
req = Request(url)

token = os.getenv('GITHUB_TOKEN')
print("Using token {}", token)
req.add_header('authorization', 'Bearer {}'.format(token))

response = urlopen(req).read()
tags_data = json.loads(response.read())

# If page is empty, it means the tag couldn't be found
Expand Down

0 comments on commit 2c5b6e1

Please sign in to comment.