Skip to content

Feature Request: Tag and branch information in response payload for webhooks

Problem Statement

When creating webhooks from non-main branches (e.g., development branch) in GitLab, the webhook payload inconsistently returns branch/tag information. Currently, the return payload always references "main" regardless of the actual source branch or tag that triggered the webhook, making it difficult for security teams to accurately track and process events from specific branches or tags in their automated workflows.

Proposed Solution

Enhance GitLab webhook payloads to include accurate and comprehensive branch/tag metadata:

  1. Add explicit branch/tag identification fields in the webhook payload:
    • source_branch: The actual branch from which the webhook was triggered
    • target_branch: The branch being targeted (for merge requests)
    • tag_name: The specific tag name when applicable
    • tag_id: The unique tag identifier
  2. Ensure consistent ref field behavior that accurately reflects the source branch/tag instead of defaulting to "main"
  3. Include branch/tag context in all webhook types (push, tag, merge request, etc.) to maintain consistency across different event types

Benefits

This enhancement would significantly improve security monitoring capabilities by enabling security teams to implement precise branch-based policies and automation, while ensuring financial services compliance requirements are met through accurate audit trails. The accurate branch/tag information would reduce false positives in security tools, streamline CI/CD pipeline decision-making, and simplify third-party integrations by eliminating the need for additional API calls to determine the actual branch context of webhook events.