我们如何在Azure DevOps构建管道中读取GIT提交消息? [英] How do we read GIT commit message inside an Azure DevOps build pipeline?
问题描述
是否可以在Azure构建管道中读取实际的GIT提交消息?
Is it possible to read the actual GIT commit message inside an Azure build pipeline?
推荐答案
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).
这篇关于我们如何在Azure DevOps构建管道中读取GIT提交消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!