Skip to content

Commit

Permalink
updated logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dusty-nv committed Dec 7, 2023
1 parent 67e1bc8 commit 6a78384
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jetson_containers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,19 @@ def github_latest_commit(repo, branch='main'):
"""
url = f"https://api.github.com/repos/{repo}/commits/{branch}"
github_token = os.environ.get('GITHUB_TOKEN')
print(f"[ENV] GITHUB_TOKEN: {github_token}")

if github_token:
log_debug(f"-- GITHUB_TOKEN={github_token}")
headers = {'Authorization': 'token %s' % github_token}
request = Request(url, headers=headers)
else:
request = Request(url)

response = urlopen(request)
data = response.read()
encoding = response.info().get_content_charset('utf-8')
msg = json.loads(data.decode(encoding))

return msg['sha']


Expand Down

0 comments on commit 6a78384

Please sign in to comment.