diff --git a/README.md b/README.md index f6f58a4..307888d 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ You must provide: - `repo_token`: Usually you'll want to set this to `${{ secrets.GITHUB_TOKEN }}` - `file`: A local file to be uploaded as the asset. -- `asset_name`: The name the file gets as an asset on a release. -- `tag`: The tag to uploaded into. If you want the current event's tag, use `${{ github.ref }}` +- `asset_name`: The name the file gets as an asset on a release. Use `$tag` to include the tag name. +- `tag`: The tag to uploaded into. If you want the current event's tag, use `${{ github.ref }}` (the `refs/tags/` prefix will be automatically stripped). - `overwrite`: If an asset with the same name already exists, overwrite it. Optional Arguments diff --git a/lib/main.js b/lib/main.js index aee98b2..801c722 100644 --- a/lib/main.js +++ b/lib/main.js @@ -99,7 +99,7 @@ function run() { } } else { - const asset_name = core.getInput('asset_name', { required: true }); + const asset_name = core.getInput('asset_name', { required: true }).replace(/\$tag/g, tag); yield upload_to_release(release, file, asset_name, tag, overwrite, octokit, context); } } diff --git a/src/main.ts b/src/main.ts index 7fd1f45..9853860 100644 --- a/src/main.ts +++ b/src/main.ts @@ -93,7 +93,7 @@ async function run() { } } else { - const asset_name = core.getInput('asset_name', { required: true }); + const asset_name = core.getInput('asset_name', { required: true }).replace(/\$tag/g, tag); await upload_to_release(release, file, asset_name, tag, overwrite, octokit, context); } } catch (error) {