Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
[config:read-releases] Fetch exact branch (#803)
Browse files Browse the repository at this point in the history
  • Loading branch information
thegreyd committed Jul 27, 2023
1 parent b85f2e1 commit 8bf270d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions doozerlib/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1533,11 +1533,10 @@ def get_releases(runtime) -> dict:
raise DoozerFatalError('A GITHUB_TOKEN environment variable must be defined!')
github_token = os.environ['GITHUB_TOKEN']

# TODO: data_path can be a local path in which case this will fail
owner = runtime.data_path.split('/')[-2]
api = GhApi(owner=owner, repo='ocp-build-data', token=github_token)
files = api.list_files(branch=runtime.group_commitish)
releases_yaml = files.get('releases.yml')
blob = api.git.get_blob(file_sha=releases_yaml['sha'])
blob = api.repos.get_content('releases.yml', ref=runtime.group_commitish)
return yaml.safe_load(base64.b64decode(blob['content']))


Expand Down

0 comments on commit 8bf270d

Please sign in to comment.