Skip to content

Commit

Permalink
Add detection for existing and new branch
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandiny committed May 15, 2020
1 parent f7785da commit a556668
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,15 @@
github_slug,
)

git_repo.git.checkout('HEAD', b=gh_branch)
git_refs = git_repo.remotes.origin.refs
git_refs_name = list(map(lambda x: str(x).split('/')[-1], git_refs))

logging.debug(git_refs_name)

if gh_branch not in git_refs_name:
git_repo.git.checkout(b=gh_branch)
else:
git_repo.git.checkout(gh_branch)

# Generate metadata
deb_file_handle = DebFile(filename=deb_file_path)
Expand All @@ -99,7 +107,6 @@
)
apt_action_metadata = list(map(lambda x: json.loads(x[0]), apt_action_metadata_str))

logging.debug(list(all_commit))
logging.debug(all_apt_action_commit)
logging.debug(apt_action_metadata_str)

Expand Down

0 comments on commit a556668

Please sign in to comment.