Getting slack notification on failed main pipelines only


I have configured slack integration in my gitlab projects to send webhooks upon merge request being opened, merged and so on.
I would like to also send a webhook in case a main pipeline fails, as I’ve scheduled weekly pipeline on main branch.

Please let me know if I can configure such a webhook.
Thanks in advance.