AppCenter:如果提交消息包含特定字符串,则进行构建

问题描述

是否可以将Microsoft AppCenter配置为在“每次推送时构建此分支”上设置构建频率,但是是否在提交消息中包含每次推送的特定字符串时进行构建。

enter image description here

解决方法

您可以为此使用以下逻辑:

if ("git show $gitCommit || grep "regex" == false) 
 // { your code } do not deploy
else
// deploy
,

您可以添加pre-build脚本,进行检查,然后在需要时致电exit 1

参考:https://github.com/microsoft/appcenter/blob/1574250f1947cf2f595d1b63414199b167087bf0/sample-build-scripts/xamarin/app-displayname/appcenter-pre-build.sh#L64