I try to create Azure DevOps pipeline and i want to append commit message to each pipeline run that is not executed from tags
.
Start of my code looks like this:
name: $(Build.SourceBranchName)
appendCommitMessageToRunName: false
And that does a trick:
The problem is, that when its executed on tag
i dont want to append commit message but any other branch, i want to. I try to code it like that:
name: $(Build.SourceBranchName)
variables:
- name: appendCommitMessageToRunName
${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:
value: false
${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/tags/')) }}:
value: true
But unfortunately, it does not work.
So how to append commit message based on source branch name?