diff --git a/action.py b/action.py index a791b02..2e8f03a 100755 --- a/action.py +++ b/action.py @@ -62,7 +62,12 @@ def _download_ref_asset(ext): repo = os.getenv("GITHUB_REPOSITORY") ref = os.getenv("GITHUB_REF") - artifact = Path(f"/tmp/{os.getenv('GITHUB_REF_NAME')}.{ext}") + # NOTE: Branch names often have `/` in them (e.g. `feat/some-name`), + # which would break the artifact path we construct below. + # We "fix" these by lossily replacing all `/` with `-`. + ref_name_normalized = os.getenv("GITHUB_REF_NAME").replace("/", "-") + + artifact = Path(f"/tmp/{ref_name_normalized}.{ext}") # GitHub supports /:org/:repo/archive/:ref<.tar.gz|.zip>. r = requests.get(f"https://github.com/{repo}/archive/{ref}.{ext}", stream=True) diff --git a/requirements.txt b/requirements.txt index e99b40c..77f1ad6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -sigstore ~= 1.1 +sigstore ~= 1.1.2 requests ~= 2.28