Currently we use Google Cloud Build to run tests, build and deploy the application. This is only run on merging with develop and live branches, not for commits on feature branches.
I would like to optionally run the CICD trigger and deploy when committing to a feature branch but would not want to do this every time I commit.
Is this possible? Can I add something to the commit message to access in the trigger like check for the text "--CICD"?
As a workaround I can use the regex matcher on the branch name to check for /CICD$/ and merge into the CICD version of the branch when I want to commit but this doesn't seem like a good approach and is error prone.
You can add a skip ci comment to not run your you pipeline
The other solution is to test the git branch name in the env vars currently running the pipeline and to exit the pipeline at the first step if it's not compliant