Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

Default tag_name and release_name to be github.ref #53

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jasonkarns
Copy link

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 jasonkarns changed the title Tag default Default tag_name and release_name to be github.ref Mar 27, 2020
@jasonkarns
Copy link
Author

closes #26

@shivapoudel
Copy link

@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

@jasonkarns
Copy link
Author

@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?

@shivapoudel
Copy link

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

@jasonkarns
Copy link
Author

bump

@LinqLover
Copy link

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 :)

@jgentes
Copy link

jgentes commented Dec 11, 2020

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

@jgentes
Copy link

jgentes commented Dec 11, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants