Skip to content

Commit

Permalink
Merge pull request #440 from camptocamp/latest-version
Browse files Browse the repository at this point in the history
Fix get latest version
  • Loading branch information
sbrunner authored Feb 14, 2022
2 parents 27e81fc + c068106 commit 9aedcb2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions c2cciutils/scripts/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,11 @@ def main() -> None:
)
if docker_config:
latest = False
full_repo = c2cciutils.get_repository().split("/")
master_branch, _ = c2cciutils.get_master_branch(full_repo)
full_repo = c2cciutils.get_repository()
full_repo_split = full_repo.split("/")
master_branch, _ = c2cciutils.get_master_branch(full_repo_split)
security_response = requests.get(
f"https://raw.githubusercontent.com/camptocamp/c2cciutils/{master_branch}/SECURITY.md"
f"https://raw.githubusercontent.com/{full_repo}/{master_branch}/SECURITY.md"
)
if security_response.ok and docker_config["latest"] is True:
security = c2cciutils.security.Security(security_response.text)
Expand Down Expand Up @@ -227,7 +228,7 @@ def main() -> None:
with tarfile.open(fileobj=response.raw, mode="r:gz") as file:
file.extractall(path=os.path.expanduser("~/.local/bin"))

owner, repo = full_repo
owner, repo = full_repo_split
commit_sha = (
subprocess.run(["git", "rev-parse", "HEAD"], check=True, stdout=subprocess.PIPE)
.stdout.strip()
Expand Down

0 comments on commit 9aedcb2

Please sign in to comment.