Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do we read GIT commit message inside an Azure DevOps build pipeline?

Is it possible to read the actual GIT commit message inside an Azure build pipeline?

like image 507
makil Avatar asked Dec 05 '22 08:12

makil


1 Answers

You have a pre-defined variable with the commit message:

Build.SourceVersionMessage  

The comment of the commit or changeset for the triggering repo. This variable is agent-scoped, and can be used as an environment variable in a script and as a parameter in a build task, but not as part of the build number or as a version control tag. Also, this variable is only available on the step level and is neither available in the job nor stage levels (i.e. the message is not extracted until the job had started and checked out the code).

like image 110
Shayki Abramczyk Avatar answered Dec 31 '22 15:12

Shayki Abramczyk