Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #576: Ensures compatibility with Github CLI v > 2.2 #597

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 16 additions & 1 deletion webviz_config/_deployment/github_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import tempfile
import subprocess
from pathlib import Path
import os


def binary_available() -> bool:
Expand Down Expand Up @@ -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:
Expand Down