I’m not seeing anything rare in your solution . In this particular case, are you saying that it’s not running that command? Can you check the value of BUILDKITE_MESSAGE in the Environment tab and confirm that is the one you are expecting?
Thank you for your message @paula. The issue is , the filter is not stoping the build when build message is ```
BUILDKITE_MESSAGE="Merge pull request #114 from xxxx/bk_automated_from_spconfig-278
I expecting the if condition execute and stop the build.
The first if loop workingZ(build.message !~ /MESSAGE_TO_IGNORE_BUILD/) as expected when error message as ```
BUILDKITE_MESSAGE="MESSAGE_TO_IGNORE_BUILD"
Firstly, it is &&, apologies, I’m always wrong with logical operators.
The only time I’ve been able to make this set up fail is by using the wrong case, for example message_to_ignore_build rather than MESSAGE_TO_IGNORE_BUILD.
I think build.message !~ /MESSAGE_TO_IGNORE_BUILD/ logic working as expected but build.message !~ /bk_automated_from_spconfig/ not working since build message having spaces. is there any way we can fix it ?
Or is there any way I can setup the build message / any other environment variable to check.
@benmc - The background, I have to check the both build message and avoid to execute the build. all I looking with spaces in build message how to validate the build message contain.
Expected Build Message when Auto PR creation and merge the commit to main branch.
BUILDKITE_MESSAGE="Merge pull request #114 from xxxx/bk_automated_from_spconfig-278
Automated PR - Testing export and import"