Handle TypeError in parsing webhook template

What does this MR do and why?

We can see some unhandled TypeError exceptions during the parsing of custom webhook templates.

This MR handles the scenario that can lead to this error.

See #386981 (comment 2197531570)

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. Create a webhook with a custom webhook template
  2. For the custom webhook template, enter:
    {
      "shas": {{commits.id}}
    }
  3. Save the webhook
  4. Test the webhook, by selecting the Test button and selecting Push events.

You should see the following error notice:

image

Edited by Luke Duncalfe

Merge request reports

Loading