-
I want to capture the github tag message in Github Actions. If user pushes tag with some message e.g.
than, I would like to capture that message(“Test Message”) inside the github actions. Any help or reference is much appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
For a one-line message you can use:
With a multiline message this will give you just the title line. For more formatting options check the formatting options described here: git-scm.comGit - git-for-each-ref Documentation |
Beta Was this translation helpful? Give feedback.
-
Thank you for the reply.
Therefore, my actions was not able to the run the git command. I have upgraded the version and it fixed the issue. |
Beta Was this translation helpful? Give feedback.
-
Sorry, I commented too early that solution worked. Following command works fine on my local. However, on build machine it doesn’t:
it returns git commit message instead of git tag message “Test Message”. |
Beta Was this translation helpful? Give feedback.
-
That’s odd… I wonder if the behavior is different between Git versions, intentionally or due to a bug? |
Beta Was this translation helpful? Give feedback.
-
So, I tried to increasing the fetch-depth as well by setting it up as 0 at checkout step. But that didn’t help even. However, I have used the following command before the command that you helped me with and it worked. :slight_smile: git fetch --depth=1 origin +refs/tags/:refs/tags/ So, final solution is :
|
Beta Was this translation helpful? Give feedback.
So, I tried to increasing the fetch-depth as well by setting it up as 0 at checkout step. But that didn’t help even. However, I have used the following command before the command that you helped me with and it worked. :slight_smile:
git fetch --depth=1 origin +refs/tags/:refs/tags/
So, final solution is :