Skip to content

Webhook doesn't fire on creation or deletion of a repository that does not belong to an organisation #11766

Closed
@JustAnotherArchivist

Description

@JustAnotherArchivist

Steps to reproduce

  1. Set up a default webhook; in my case, I used a Gitea webhook with JSON POST, but I would be surprised if the details mattered.
  2. Create a new repository under a user, i.e. outside of an organisation.

Expected behaviour

A repository webhook event is sent to signal the creation of the new repository.

Actual behaviour

No webhook call.

Repository creation and deletion events are only executed when the repo belongs to an organisation:

if u.IsOrganization() {

if u.IsOrganization() {

While that probably made sense in the past, it doesn't mix well with default webhooks nor with the new system-wide webhooks (#10546). Those should fire on all repositories.

(I have not tested system-wide webhooks, but given the code mentioned above, it should behave the same.)

System information

  • Gitea version (or commit ref): 1.11.6
  • Git version: not relevant
  • Operating system: unknown, but I can ask if it matters
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
    • Can't test currently
  • Log gist: not relevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions