diff --git a/CHANGELOG.md b/CHANGELOG.md index 270cea9c..5ecb9bf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#539](https://github.com/equinor/webviz-config/pull/539) - Support using OAuth behind proxy. If silent refresh of OAuth token fails, fall back to loud refresh of token instead of raising internal server error. - [#550](https://github.com/equinor/webviz-config/pull/550) - Change user data directory on Windows from `Application Data` to `AppData` (both work on Windows 10, but only the latter works on Windows 11). - [#546](https://github.com/equinor/webviz-config/pull/546) - Replaced `cp` with `copyfiles` in `package.json`'s `postinstall` script and added note to `README`. +- [#552](https://github.com/equinor/webviz-config/pull/552) - Fix Windows problem when calling `gh api` in Radix deploy. ## [0.3.6] - 2021-11-08 diff --git a/webviz_config/_deployment/github_cli.py b/webviz_config/_deployment/github_cli.py index e7b172b0..778302a4 100644 --- a/webviz_config/_deployment/github_cli.py +++ b/webviz_config/_deployment/github_cli.py @@ -82,27 +82,22 @@ def turn_on_github_vulnerability_alers(directory: Path) -> None: def _call_post_api(endpoint: str, data: dict, directory: Path) -> None: - _, temp_file = tempfile.mkstemp() - - try: - Path(temp_file).write_text(json.dumps(data)) - - subprocess.run( - [ - "gh", - "api", - endpoint, - "--method", - "POST", - "--input", - temp_file, - "--silent", - ], - check=True, - cwd=directory, - ) - finally: - Path(temp_file).unlink() + subprocess.run( + [ + "gh", + "api", + endpoint, + "--method", + "POST", + "--input", + "-", + "--silent", + ], + input=json.dumps(data), + check=True, + cwd=directory, + text=True, + ) def add_webhook(directory: Path, receiver_url: str, secret: str) -> None: