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
This commit is contained in:
yin1999 2021-03-23 12:51:28 +08:00
parent e99df7cd80
commit fa2696fb58
No known key found for this signature in database
GPG key ID: 29A80EEAAFA37A22

View file

@ -142,8 +142,11 @@ export const release = async (
releaser: Releaser
): Promise<Release> => {
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