Because there is currently no way to configure default git hooks, I have created a default webhook that installs (or updates) a pre-recieve hook in the repository.
The webhook is configured with ‘trigger on’ -> ‘custom events’ -> ‘create’ + ‘push’ + ‘repository’
I expected the webhook to trigger when a user creates a repository in Gitea, since the comment on the ‘repository’ trigger is ‘repository created or deleted’.
When I create an empty repository, the hook is not triggered.
After I initialize the repo and push the first content, the ‘create’ and ‘push’ events do trigger the webhook, but the pre-recieve git hook that gets installed is not run for this push. If I push more content, the git hook also triggers.
Is this a bug? How can I get the webhook to trigger the moment a repository is created?