How to get git tag message?

git
#1

Hi!

I usually do tagging using this command
git tag -a v0.0.1

After the command running, the terminal will display input for tag messages, I input some messages in it then push tag to origin.

My question is, how I get those message? Currently I use Generate Changelog step but it’s not working. Also I tried using exposed variable $BITRISE_GIT_MESSAGE but it’s only provide message from last git commit in the tag.

Please halp… :smiley:

0 Likes

#2

To anyone looking for this solution, you can use:

GIT_TAG_MESSAGE=$(git tag -l --format='%(contents)' $BITRISE_GIT_TAG)

then export the variable using envman

envman add --key GIT_TAG_MESSAGE --value "$GIT_TAG_MESSAGE"

Your tag message will available inside $GIT_TAG_MESSAGE

1 Like