git-auto-commit-action icon indicating copy to clipboard operation
git-auto-commit-action copied to clipboard

Remove Quotes from Tags

Open YunaBraska opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe. I use variables for the tagging_message. For unknown reason the variable comes with double quotes which is not valid for a tag. Its such a pain to delete the tag afterwords as git isn't recognising the tag as long as you don't escape the quotes.

Describe the solution you'd like Delete first and last single and double quotes on a tag. This could be a common issue which can happen and is also too hard to fix in bash.

Describe alternatives you've considered my current workaround looks like this in bash: [[ "${new_tag}" == \"*\" || "${new_tag}" == \'*\' ]] && new_version="${new_tag:1:-1}" This deletes the quotes if there are some.

YunaBraska avatar Sep 13 '22 05:09 YunaBraska

@YunaBraska Could you share an example workflow where this has become an issue for you? Would be a great starting point to understand your issue more and find a permanent fix in the Action.

stefanzweifel avatar Sep 13 '22 06:09 stefanzweifel

Sure, currently I test reusable workflows here: https://github.com/YunaBraska/YunaBraska/blob/feat/0/reusable_workflow/.github/workflows/wc_maven_tag.yml#L114 Its probably an edge case scenario but it could happen that some one is storing the tag with quotes in a variable which will end in a little mess on git :/ I just thought it would be a nice feature and quality improvement to validate the input.

YunaBraska avatar Sep 13 '22 09:09 YunaBraska

Thanks for providing a link to your workflow, which showcases your problem.

I don't think this is an issue that can be solved nicely in git-auto-commit. Quotes " are not illegal charaters for git tags. They are certainly uncommon, but they are allowed. If I would automatically strip them inside the Action, I'm sure there will be at least one user rushing to the issues/discussions and telling me, I've broken their workflow.

Manipulating user input also feels icky.

stefanzweifel avatar Oct 05 '22 18:10 stefanzweifel