cloud-build-notifiers icon indicating copy to clipboard operation
cloud-build-notifiers copied to clipboard

Add trigger name to slack notification

Open bouk opened this issue 4 years ago • 4 comments

Thanks for this project, it's super useful. I'd love it if you added the name of the trigger to the slack notification, which would make it easier to see what a notification is for

bouk avatar Dec 17 '20 16:12 bouk

You're welcome 😄 I totally agree - for silly reasons we don't include the trigger name in the Pub/Sub payload (or Build resource for that matter). Until we provide the trigger name in the payload or provide it as an available substitution, the best alternative is to stick a GCB gRPC (or JSON) client in the notifier and call GetBuildTrigger, which should include the trigger name.

Please feel free to send a PR for this functionality as others would definitely benefit!

LOZORD avatar Dec 18 '20 00:12 LOZORD

PR submitted #91

bouk avatar Dec 18 '20 10:12 bouk

+1 this is really useful project. This feature would be ultra useful - otherwise given you have multiple apps being triggered doesn't appear to be a way to distinguish them.

jrissler avatar Feb 12 '21 21:02 jrissler

Hi all! We on Cloud Build are aware of this need but want to have a standardized implementation for all notifiers, so I filed #95. We're currently waiting on our PM to share a doc in this repo for this set of features. I can't give a timeline, but I was told Soon ™️ . The implementation will be open to the community to code up.

LOZORD avatar Feb 12 '21 22:02 LOZORD

You can use {{.Build.Substitutions.TRIGGER_NAME}} in the template to get the trigger name.

vicpadilla avatar Jul 12 '23 22:07 vicpadilla