From ec0ba8651fadf304c3186a3b8812ab8a7f8dc3d4 Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Mon, 10 Aug 2020 05:21:17 +0200 Subject: [PATCH] 2.1.0 --- CHANGELOG.md | 3 +++ dist/index.js | 2 +- package.json | 2 +- src/main.ts | 5 ++++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68959e6e..a5ab0ce1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## [2.1.0] - 2020-08-10 +- Strip refs/heads/ from the input tag [#23](https://github.com/svenstaro/upload-release-action/pull/23) (thanks @OmarEmaraDev) + ## [2.0.0] - 2020-07-03 - Add `prerelease` input parameter. Setting this marks the created release as a pre-release. - Add `release_name` input parameter. Setting this explicitly sets the title of the release. diff --git a/dist/index.js b/dist/index.js index 0980dd45..a8ce4084 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2263,7 +2263,7 @@ function run() { // Get the inputs from the workflow file: https://github.com/actions/toolkit/tree/master/packages/core#inputsoutputs const token = core.getInput('repo_token', { required: true }); const file = core.getInput('file', { required: true }); - const tag = core.getInput('tag', { required: true }).replace('refs/tags/', ''); + const tag = core.getInput('tag', { required: true }).replace('refs/tags/', '').replace('refs/heads/', ''); const file_glob = core.getInput('file_glob') == 'true' ? true : false; const overwrite = core.getInput('overwrite') == 'true' ? true : false; const prerelease = core.getInput('prerelease') == 'true' ? true : false; diff --git a/package.json b/package.json index 041296e0..dff41b32 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "upload-release-action", - "version": "2.0.0", + "version": "2.1.0", "private": true, "description": "Upload files to a GitHub release", "main": "lib/main.js", diff --git a/src/main.ts b/src/main.ts index de103476..c8c014ac 100644 --- a/src/main.ts +++ b/src/main.ts @@ -104,7 +104,10 @@ async function run(): Promise { // Get the inputs from the workflow file: https://github.com/actions/toolkit/tree/master/packages/core#inputsoutputs const token = core.getInput('repo_token', {required: true}) const file = core.getInput('file', {required: true}) - const tag = core.getInput('tag', {required: true}).replace('refs/tags/', '').replace('refs/heads/', '') + const tag = core + .getInput('tag', {required: true}) + .replace('refs/tags/', '') + .replace('refs/heads/', '') const file_glob = core.getInput('file_glob') == 'true' ? true : false const overwrite = core.getInput('overwrite') == 'true' ? true : false