I'm using Cloud Build as a CI/CD solution. My branching strategy follows this pattern: dev, stage and prod branches reflect exactly what I have in each of my environments. Any other branch is just a regular branch for development.
By following this pattern, I need to build/test in any branch except the main ones, and deploy only when pushes are in dev/stage/prod.
As Cloud Build doesn't support expressing this in a single YAML file, I have two: build.yaml and deploy.yaml.
Then I created two Build Triggers, like this:
The first works just fine, it triggers the steps described in deploy.yaml if anything is pushed to dev/stage/prod. But the second, although it accepts the RegExp and evaluates a preview of branches (notice you don't see the main branches):
When the build gets triggered (yes, it is triggered automatically!), it fails:
A bit of Googling tells me Go-lang (which supposedly is the back-end where this regexp is being evaluated here) does not support Lookahead in RegExp.
How can I solve this problem?



