question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No way to use a multi-word git tag message?

See original GitHub issue

There doesn’t seem to be any way to pass a --message that has multiple word to the Git tag command. For example this attempt:

  - name: "Commit changes"
    uses: EndBug/add-and-commit@v7
    with:
      add: 'CHANGELOG.md'
      message: 'Release 1.0.0'
      tag: "v1.0.0 --annotate --message 'Release 1.0.0'"

Fails with:

2021-04-13T10:51:08.1831581Z > Tagging commit...
2021-04-13T10:51:08.1889446Z ##[error]Error: fatal: Failed to resolve '1.0.0'' as a valid ref.

2021-04-13T10:51:08.1904561Z ##[error]Error: fatal: Failed to resolve '1.0.0'' as a valid ref.

2021-04-13T10:51:08.1908826Z > Pushing commit to repo...

and this:

 - name: "Commit changes"
    uses: EndBug/add-and-commit@v7
    with:
      add: 'CHANGELOG.md'
      message: 'Release 1.0.0'
      tag: 'v1.0.0 --annotate --message "Release 1.0.0"'

results in the tag message being literally "Release 1.0.0".

I tried all kinds of YAML quoting, but the problem is really this function:

https://github.com/EndBug/add-and-commit/blob/f4b07e6873721ec26cd5d31d795fe378f2855004/src/util.ts#L41-L43

There is no way to pass arguments to that so that it would keep the Release 1.0.0 as one string with no extra quotes around it:

https://www.typescriptlang.org/play?ts=4.2.3#code/GYVwdgxgLglg9mABAWwIZQgCwOIygQQCcBzAZwApSpCYxiAuRKmugSkQG8AoRRQgUyghCSZrWIA6NBkzkA9OQD89ANoA9ADqkARAF0A1AB9t6vQCptrfXOLtDhxCt1cAvly4QEpOABt+EnzhicmksXAISCm0ANwBGCQAGRMQAWhTUMDA4KHR+VJTkflJSVGI8gHIAJX4-VFI8+KSE8stWAG4PL19-QODQnDwiMnJyuMTktIysnKg8tMLi0rztatr6xEbE7XLWds6wbz8AoJD0MMHI8hjNhPyp7Nz8hZKyxA0Vmv46hvGE99aOp4Dt1jn0zgMIsNRjc7pkHrMnkUXnkNFVPt8Nr9UTt2kA

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
EndBugcommented, Apr 16, 2021

Fix has been published in v7.1.2 (also v7 and latest). Thanks again for the report!

1reaction
EndBugcommented, Apr 14, 2021

Happy to see that you found a workaround 😃 Anyway, I’ll try to see if I can fix it as soon as I can

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to include newline characters in git tag messages
Use command git tag -a v1.0.0 and hit enter. Don't write -m · It will open up your default code editor, write message,...
Read more >
Git - Tagging - Git SCM
This command lists the tags in alphabetical order; the order in which they are displayed has no real importance. ... If you want...
Read more >
Effective Go - The Go Programming Language
Finally, the convention in Go is to use MixedCaps or mixedCaps rather than underscores to write multiword names. Semicolons. Like C, Go's formal...
Read more >
Git Tagging Explained - Initial Commit
Using git tag -a without including a message inline will cause Git to open a file in your default editor that stores the...
Read more >
Python - Variable Names - W3Schools
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found