diff --git a/CHANGELOG.md b/CHANGELOG.md index 17ed32a9..8048918f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - [#588](https://github.com/equinor/webviz-config/pull/588) - Added compatibility with upstream dependency `bleach >= 5`. +- [#576](https://github.com/equinor/webviz-config/pull/576) - Ensured compatibility with Github CLI v. >2.2 when deploying to Radix ## [0.3.9] - 2022-02-09 diff --git a/webviz_config/_deployment/github_cli.py b/webviz_config/_deployment/github_cli.py index 778302a4..807f0dbc 100644 --- a/webviz_config/_deployment/github_cli.py +++ b/webviz_config/_deployment/github_cli.py @@ -3,6 +3,7 @@ import tempfile import subprocess from pathlib import Path +import os def binary_available() -> bool: @@ -62,7 +63,21 @@ def create_github_repository(github_slug: str, directory: Path) -> Path: cwd=directory, ) - return directory / github_slug.split("/")[1] + # Fix Issue 576: Compatibility with Github CLI v. >2.2 + clone_path = directory / github_slug.split("/")[1] + + if not os.path.exists(clone_path): + subprocess.run( + ["gh", "repo", "clone", github_slug], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + # capture_output=True, <-- Added in Python 3.7 + check=True, + cwd=directory, + ) + + + return clone_path def turn_on_github_vulnerability_alers(directory: Path) -> None: