From fa2696fb58b8f46e5317b7b512bde552f4465cdc Mon Sep 17 00:00:00 2001 From: yin1999 <15844309+yin1999@users.noreply.github.com> Date: Tue, 23 Mar 2021 12:51:28 +0800 Subject: [PATCH] Fix: remove the substring "refs/tags/" in tag_name Currently, when using github.GITHUB_REF as tag_name, the action will remove the substring "refs/tags/" which prevents uploading asset --- src/github.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/github.ts b/src/github.ts index 4a28672..e772aa7 100644 --- a/src/github.ts +++ b/src/github.ts @@ -142,8 +142,11 @@ export const release = async ( releaser: Releaser ): Promise => { const [owner, repo] = config.github_repository.split("/"); + // using githu_ref only if input_tag_name is empty or equals to github_ref const tag = - config.input_tag_name || config.github_ref.replace("refs/tags/", ""); + !config.input_tag_name || config.input_tag_name === config.github_ref + ? config.github_ref.replace("refs/tags/", "") + : config.input_tag_name; try { // you can't get a an existing draft by tag // so we must find one in the list of all releases