-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fire webhooks when repo is created from a template #11534
Comments
Looking at this, when I create repo from a template I get a 'repo created' webhook same as if I use the Web site. I'm not sure how to reproduce this or whats expected/not working. I guess to be clear we only support repo created webhooks for organization owned repos and not individual users as far as I can tell: gitea/modules/notification/webhook/webhook.go Lines 100 to 112 in 777015c
Is there a more detailed description of whats expected vs whats happening? |
so not an issue? |
sorry fired this off in a rush, the ‘push’ event is the one I’m thinking of: |
Create repository is not a push event, so if all you have checked is 'push events' for Webhook it should not fire a hook if you create a new repository from the Web interface. It is a "repository" event as shown in the previously mentioned code: gitea/modules/notification/webhook/webhook.go Lines 100 to 112 in 777015c
And if you look at a hook sent for creating a repo it will have Unless you have a specific set of steps to reproduce creating a repository causing a created repo hook to be sent with a push type? |
When commits are created via repo creation (template or not), this function is used to set the environment, which would stop hooks from firing. gitea/models/helper_environment.go Lines 26 to 34 in 0b8b81e
Lines 136 to 139 in 0b8b81e
Lines 271 to 274 in 0b8b81e
I believe you could get a |
Push event will trigger when use push to create and files are added, which seems right in the sense that somebody actually ran 'git push' in that situation. The create repo hook is still not a push event, but Gitea will consider the file commits (if there are any) as separate push events in that scenario -- they were manually pushed so that seems somewhat correct. So if something should be triggered specifically by repo creation it should look for repository event which is what the 'repo creation' hook is considered and the only hook guaranteed to run when a new repo is created no matter how. |
@mrsdizzie ahh ok, but the repo creation webhook is only supported in an organisation context - so using a system webhook, creating a repo as a user (not in an org), then expecting to see any webhook fired is expected behaviour right now? (until the work is done to support that on the user level) If so looks like this is a feature request rather than a bug report - apologies for the confusion & back-and-forth everyone! |
I'm going to move this to 1.13 as it's currently intended behavior. 🙂 |
This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions. |
This issue has been automatically closed because of inactivity. You can re-open it if needed. |
[x]
):Description
As requested from #9126
Currently webhooks aren't being fired when a repository is created from a template.
The same webhooks which are fired when a repository is created not via a template should be fired.
The text was updated successfully, but these errors were encountered: