Default asset_name to the original file name (fixes #4)

This commit is contained in:
Sven-Hendrik Haase
2020-07-03 09:17:13 +02:00
parent c0f4101399
commit 588487bf09
4 changed files with 18 additions and 17 deletions

View File

@@ -131,9 +131,10 @@ async function run(): Promise<void> {
core.setFailed('No files matching the glob pattern found.')
}
} else {
const asset_name = core
.getInput('asset_name', {required: true})
.replace(/\$tag/g, tag)
const asset_name =
core.getInput('asset_name') !== ''
? core.getInput('asset_name').replace(/\$tag/g, tag)
: path.basename(file)
const asset_download_url = await upload_to_release(
release,
file,