From 94502fe17555e24b2fe8b7e3b6cd179ebcbca1aa Mon Sep 17 00:00:00 2001 From: Omar Emara Date: Wed, 5 Aug 2020 18:54:20 +0200 Subject: [PATCH 1/2] Strip refs/heads/ from the input tag. This patch strips refs/heads/ from the input tag to make it easier to use the action with pushes on branches. --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 0ec155e..de10347 100644 --- a/src/main.ts +++ b/src/main.ts @@ -104,7 +104,7 @@ 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/', '') + 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 From 24dc1f0ef13830810f903a94cb615a7cf2bdf559 Mon Sep 17 00:00:00 2001 From: Omar Emara Date: Fri, 7 Aug 2020 17:02:07 +0200 Subject: [PATCH 2/2] Update the description of the tag input. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ea02b98..0bf250d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ 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. -- `tag`: The tag to upload into. If you want the current event's tag, use `${{ github.ref }}` (the `refs/tags/` prefix will be automatically stripped). +- `tag`: The tag to upload into. If you want the current event's tag or branch name, use `${{ github.ref }}` (the `refs/tags/` and `refs/heads/` prefixes will be automatically stripped). Optional Arguments