Skip to content

Commit

Permalink
feat(publishing): warn about missing github token (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
rti authored Oct 31, 2023
1 parent 9f596af commit f65cc11
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Docker/publish/download_artifacts/download_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@
for artifact in artifactsMetadata['artifacts']:
print('Downloading %d bytes from %s' % (artifact['size_in_bytes'], artifact['name']))

r = requests.get( artifact['archive_download_url'], allow_redirects=True, headers={"Authorization": 'Bearer ' + os.getenv('GITHUB_TOKEN') } )
token = os.getenv('GITHUB_TOKEN')
if token is None:
raise Exception("need a github access token with repo and workflow scope in GITHUB_TOKEN env")

r = requests.get(
artifact['archive_download_url'],
allow_redirects=True,
headers={"Authorization": 'Bearer ' + token } )

if r.status_code != 200:
errorMessage = "Unknown error (http " + str(r.status_code) + ")."
try:
Expand Down

0 comments on commit f65cc11

Please sign in to comment.