include head_commit in push webhooks if tag #2488

Closed
opened 2025-11-02 04:38:15 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @bradrydzewski on GitHub (Nov 3, 2018).

It would be great if Gitea could include the head_commit in the push webhook if the object is a tag. For reference this is what GitHub sends in the push hook if the object is a tag:

{
  "ref": "refs/tags/v0.0.1",
  "before": "0000000000000000000000000000000000000000",
  "after": "d2b75aa7797ec26b088fa2dd527e9d2c052fcedd",
  "created": true,
  "deleted": false,
  "forced": false,
  "base_ref": "refs/heads/master",
  "compare": "https://github.com/bradrydzewski/drone-test-go/compare/v0.0.1",
  "commits": [

  ],
  "head_commit": {
    "id": "d2b75aa7797ec26b088fa2dd527e9d2c052fcedd",
    "tree_id": "f38d6b02c9ee18de68e5e6682721a22df4c9a29d",
    "distinct": true,
    "message": "Update .drone.yml",
    "timestamp": "2018-06-19T19:03:12-07:00",
    "url": "https://github.com/bradrydzewski/drone-test-go/commit/d2b75aa7797ec26b088fa2dd527e9d2c052fcedd",
    "author": {
      "name": "Brad Rydzewski",
      "email": "noreply@github.com",
      "username": "bradrydzewski"
    },
    "committer": {
      "name": "GitHub",
      "email": "noreply@github.com",
      "username": "web-flow"
    },
    "added": [

    ],
    "removed": [

    ],
    "modified": [
      ".drone.yml"
    ]
  }
}

For my specific use case, I would like to display the commit details (email address, commit message, etc) in the user interface in Drone. Currently these fields are blank. Thanks!

Originally created by @bradrydzewski on GitHub (Nov 3, 2018). It would be great if Gitea could include the `head_commit` in the `push` webhook if the object is a tag. For reference this is what GitHub sends in the push hook if the object is a tag: ``` { "ref": "refs/tags/v0.0.1", "before": "0000000000000000000000000000000000000000", "after": "d2b75aa7797ec26b088fa2dd527e9d2c052fcedd", "created": true, "deleted": false, "forced": false, "base_ref": "refs/heads/master", "compare": "https://github.com/bradrydzewski/drone-test-go/compare/v0.0.1", "commits": [ ], "head_commit": { "id": "d2b75aa7797ec26b088fa2dd527e9d2c052fcedd", "tree_id": "f38d6b02c9ee18de68e5e6682721a22df4c9a29d", "distinct": true, "message": "Update .drone.yml", "timestamp": "2018-06-19T19:03:12-07:00", "url": "https://github.com/bradrydzewski/drone-test-go/commit/d2b75aa7797ec26b088fa2dd527e9d2c052fcedd", "author": { "name": "Brad Rydzewski", "email": "noreply@github.com", "username": "bradrydzewski" }, "committer": { "name": "GitHub", "email": "noreply@github.com", "username": "web-flow" }, "added": [ ], "removed": [ ], "modified": [ ".drone.yml" ] } } ``` For my specific use case, I would like to display the commit details (email address, commit message, etc) in the user interface in [Drone](https://github.com/drone/drone). Currently these fields are blank. Thanks!
GiteaMirror added the hacktoberfesttype/proposaltype/enhancementgood first issue labels 2025-11-02 04:38:15 -06:00
Author
Owner

@tobybellwood commented on GitHub (Sep 12, 2020):

more broadly, the head_commit is never populated - even for pushes. I've had a quick look at the attached PR, but it seems that Gitea has refactored some of their models since it was created and now is probably not applicable.

We do the same for Lagoon using the head_commit to display the full URL for the after commit on a push or create, and would like to be able to use our GitHub:x handlers instead of creating new ones just for Gitea

@tobybellwood commented on GitHub (Sep 12, 2020): more broadly, the head_commit is never populated - even for pushes. I've had a quick look at the attached PR, but it seems that Gitea has refactored some of their models since it was created and now is probably not applicable. We do the same for [Lagoon](https://www.github.com/amazeeio/lagoon) using the head_commit to display the full URL for the `after` commit on a push or create, and would like to be able to use our GitHub:x handlers instead of creating new ones just for Gitea
Author
Owner

@zeripath commented on GitHub (Sep 12, 2020):

This would very likely be a very a simple pr.

@zeripath commented on GitHub (Sep 12, 2020): This would very likely be a very a simple pr.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2488