I am using declarative pipelines and would like to run a stage only when it matches a certain branch and the latest commit does not include certain text.
Matching the branch is the easy part:
when {
branch 'master'
}
But for checking the latest commit message, I am unsure how to add in this check.
I have come across this answer which is very much the kind of thing I am trying to achieve.
I am wondering if I need to use an expression clause that would contain the logic similar to the answer linked to above, to query the git log and parse\check the latest commit message contains my supplied regex pattern.
Can anyone point me at any snippets that would help me here?
Thanks