How do I get commit message in .gitlab-ci.yml?

Is there any possibility to get the commit message in .gitlab-ci.yml ? I couldn’t find it within the predefined variables (https://docs.gitlab.com/ce/ci/variables/README.html).

2 Likes

I want know too

You can get your commit message in CI with this:

echo $(git log -1 --pretty=%B)

Output in CI looks like this:

$ echo $(git log -1 --pretty=%B)
Here is my awesome commit message