makil
makil

Reputation: 559

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?

Upvotes: 11

Views: 9359

Answers (1)

Shayki Abramczyk
Shayki Abramczyk

Reputation: 41715

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).

Upvotes: 27

Related Questions