Skip to content

Commit

Permalink
build/package: Move GH_TOKEN access
Browse files Browse the repository at this point in the history
It is only used by _download_artifact in a GitHub action, it is not set
by Jenkins.
  • Loading branch information
jonasdn committed Jun 30, 2021
1 parent 569c5e4 commit 6c9e038
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/build/package
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ __author__ = 'kristoffer'

download_dir = "/download"

GH_TOKEN = os.environ['GH_TOKEN']


def _read_versions(path, target_versions):
if len(target_versions) > 0:
Expand Down Expand Up @@ -41,6 +39,8 @@ def _read_manifest(path, platform, versions):


def _download_artifact(uri) -> io.BytesIO:
GH_TOKEN = os.environ['GH_TOKEN']

headers = {'Authorization': f'token {GH_TOKEN}'}
req = urllib.request.Request(uri, headers=headers)
with urllib.request.urlopen(req) as response:
Expand Down

0 comments on commit 6c9e038

Please sign in to comment.