Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Signed-off-by: William Woodruff <william@yossarian.net>
  • Loading branch information
woodruffw authored Feb 15, 2023
1 parent 77a8ee7 commit 0770fc2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions action.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 0770fc2

Please sign in to comment.