How to add/write more filters in YAML file?

Viewed 13

This is the script I used to get Email Notifications when CloudBuild triggers pipeline: I used this documentation as reference:

https://cloud.google.com/build/docs/configuring-notifications/configure-smtp#filtering_by_trigger_id

When I get email notification it only shows status, but I want to add more filters like Build number, trigger name and trigger ID. How do I write in this below script so that I can see what is build number, trigger name and id?

Below is the code:

kind: SMTPNotifier
metadata:
  name: smtp-notifier
spec:
  notification:
    filter: build.status in [Build.Status.SUCCESS, Build.Status.FAILURE, Build.Status.TIMEOUT]
    delivery:
      server: server-name
      port: "123"
      sender: no-reply-dev@abc.com
      from: no-reply-dev@abc.com
      recipients:
        - xyz@abc.com
        # optional: more emails here
      password:
        secretRef: smtp-password
  secrets:
  - name: smtp-password
    value: projects/project-id/secrets/service-name/versions/latest
0 Answers
Related