Skip to content

Conversation

Freed-Wu
Copy link

git tag 0.0.1 and tag_version_prefix: "" will trigger this bug. ${INPUT_TAG_VERSION_PREFIX:-v} will return 'v' when $INPUT_TAG_VERSION_PREFIX is ""

Description

Motivation and Context

Closes #

Screenshots (if appropriate)

How Has This Been Tested

  • I have tested using MacOS
  • I have tested using Linux
  • I have tested using Windows

Checklist

  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.

@aksh1618
Copy link
Owner

Hey there @Freed-Wu, my sincere apologies, I somehow missed this. I can't recall why I set a default value for this, even though this has been set as a required parameter. I'm a bit out of touch w.r.t. github actions, feel free to chip in if you can think of a possible reason. I think if it's a required parameter, then it's safe to not require a default value for it in the entrypoint script.

If you'd like to go ahead with this MR, we need to make at least the following changes:

  • Remove the default value entirely, not just the colon, as that will just change the name of the variable
  • Remove the mention of default value of this parameter from all touchpoints: README.md, action.yml etc.

@Freed-Wu
Copy link
Author

In my fork, I have changed it to

NEW_RELEASE=${GITHUB_REF#refs/tags/}
NEW_RELEASE=${NEW_RELEASE#${INPUT_TAG_VERSION_PREFIX:-v}}

And it works for me.

`git tag 0.0.1` and `tag_version_prefix: ""` will trigger this bug.
`${INPUT_TAG_VERSION_PREFIX:-v}` will return 'v' when `$INPUT_TAG_VERSION_PREFIX` is ""
@Freed-Wu
Copy link
Author

Freed-Wu commented Nov 3, 2024

We should use GITHUB_REF_NAME not GITHUB_REF. document is here. GITHUB_REF is "refs/tags/$GITHUB_REF_NAME"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants