Skip to content

Tag creation/deletion incorrectly triggers Push webhook (should only emit Create/Delete event) #35449

@AbhishekGit-Code

Description

@AbhishekGit-Code

Description

Description

In Gitea 1.22.2, creating or deleting a tag emits a "push" webhook with ref set to refs/tags/....
This behavior triggers CI jobs subscribed to branch push events, even though semantically it's a tag operation.

Expected Behavior

Tag creation/deletion should trigger only a create or delete event—not a push event—so that pipelines can be scoped properly.

Actual Behavior

Gitea currently sends a push webhook for both regular branch pushes and tag events, causing unintended execution in pipelines expecting only branch triggers.

Steps to Reproduce

  1. Configure a pipeline job with webhook:
    • Trigger On: Push Event
    • Branch filter: refs/heads/main
  2. Create (or delete) a tag in Gitea.
  3. Observe that the pipeline is triggered anyway (because ref contains refs/tags/..., but the event type is still push).

Proposal

  • Add differentiation in webhook logic: a tag operation should optionally trigger only the create or delete webhook.
  • Or at minimum, support an optional configuration to exclude push events whose ref starts with refs/tags/.

This change would prevent branch-only pipelines from being inadvertently triggered by tag-related actions.

Gitea Version

1.22.2

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

2.49.0

Operating System

Windows

How are you running Gitea?

Windows Service

Database

None

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions