From 0770fc2924c3dcd1790d923860dd08e4090f6957 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Wed, 15 Feb 2023 15:41:35 -0500 Subject: [PATCH] Apply suggestions from code review Signed-off-by: William Woodruff --- action.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action.py b/action.py index 53e8a9a..a42b088 100755 --- a/action.py +++ b/action.py @@ -59,16 +59,16 @@ def _download_ref_asset(ext): repo = os.getenv('GITHUB_REPOSITORY') ref = os.getenv("GITHUB_REF") - artifact = f"/tmp/{os.getenv('GITHUB_REF_NAME')}{ext}" + artifact = Path(f"/tmp/{os.getenv('GITHUB_REF_NAME')}").with_suffix(ext) # GitHub supports /:org/:repo/archive/:ref<.tar.gz|.zip>. r = requests.get(f"https://github.com/{repo}/archive/{ref}{ext}", stream=True) r.raise_for_status() - with Path(artifact).open("wb") as io: + with artifact.open("wb") as io: for chunk in r.iter_content(chunk_size=None): io.write(chunk) - return artifact + return str(artifact) def _sigstore_sign(global_args, sign_args):