WebHook creation and using

I am completely newbie here, so sorry for primitive question.
Gitea is working fine, i need to set up a simple hook to prevent commits on main branch.
I set up a webhook see pic.1

I have a response from Test Delivery, see pic.2

But where to put webhook.php file?
I put it in the root but its not fired, see pic.3.

Here is the content of the webhook.php (took from stackoverflow):

#!/bin/sh

branch=“$(git rev-parse --abbrev-ref HEAD)”

if [ “$branch” = “main” ]; then
echo “You can’t commit directly to main branch”
exit 1
fi

I tried to look through forum here, read around 30 topic about webhooks, looks like it too simple question to ask but same time i dint find anything on documentation.

This was not enough for me Webhooks - Docs

Please, help.