create-release
create-release copied to clipboard
Default tag_name and release_name to be `github.ref`
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.)
closes #26
@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:
@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 Thanks for the suggestion, I have raised a PR #66 for this separately.
bump
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 :)
I followed the readme, ended up with 'Release refs/heads/master' :(
github.sha
doesn't work due to this error: pre_receive Sorry, branch or tag names consisting of 40 hex characters are not allowed.