create-release icon indicating copy to clipboard operation
create-release copied to clipboard

Default tag_name and release_name to be `github.ref`

Open jasonkarns opened this issue 4 years ago • 8 comments

For most workflows (indeed, even in the example for this action), this action will be scoped to only run for version tags. So for most workflows, it is highliy likely that the tag-name for the release ought to be the same as ${{ github.ref }}. In the spirit of convention over configuration, that would make a desirable default.

Similarly for the release_name. This actually results in the same behavior as when creating a release manually through the UI (the default release name is the same as the tag name, unless given explicitly).

(Pattern of setting defaults via expression directly in the manifest taken from actions/checkout.)

jasonkarns avatar Mar 27 '20 03:03 jasonkarns

closes #26

jasonkarns avatar Mar 27 '20 21:03 jasonkarns

@jasonkarns Additionally please remove the refs/tags portion of the string from body:

const body = core.getInput('body', { required: false }).replace('refs/tags/', '');

Currently, it is displaying like this: image

shivapoudel avatar May 05 '20 10:05 shivapoudel

@shivapoudel I'm not against that, but doing so would be a more invasive change that would decrease the chance this PR gets merged. Perhaps open as a separate PR?

jasonkarns avatar May 05 '20 15:05 jasonkarns

@jasonkarns Thanks for the suggestion, I have raised a PR #66 for this separately.

shivapoudel avatar May 05 '20 16:05 shivapoudel

bump

jasonkarns avatar Jul 13 '20 17:07 jasonkarns

In my repository, github.ref evaluates to refs/heads/master when I push directly to the master branch. As a consequence, I had to spend some time on the non-trivial task to remove a tag with this special name from the remote again ... (turns out that, through detours, you can delete a tag directly from the GitHub web interface). Did they change this behavior, or could I have misconfigured my workflow?

Otherwise, I'd propose to choose another default tag name, also in the example in the README.md, maybe based on the commit SHA (github.sha) or the current date (for example, this can be achieved using the 1466587594/get-current-time@v1 action).

Just my 2 cents :)

LinqLover avatar Dec 09 '20 02:12 LinqLover

I followed the readme, ended up with 'Release refs/heads/master' :(

jgentes avatar Dec 11 '20 00:12 jgentes

github.sha doesn't work due to this error: pre_receive Sorry, branch or tag names consisting of 40 hex characters are not allowed.

jgentes avatar Dec 11 '20 00:12 jgentes