aboutsummaryrefslogtreecommitdiffstats
path: root/modules/structs
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2023-01-25 05:47:53 +0100
committerGitHub <noreply@github.com>2023-01-24 23:47:53 -0500
commitc8139c0f642a308b544d2f17e7b728ee6762a0eb (patch)
tree0b29563e5a3fe8511e18a1eb6f2cfdf2453fc88a /modules/structs
parenta31fedd2c2def13e29a962c751c449491d5a1588 (diff)
downloadgitea-c8139c0f642a308b544d2f17e7b728ee6762a0eb.tar.gz
gitea-c8139c0f642a308b544d2f17e7b728ee6762a0eb.zip
Webhooks: for issue close/reopen action, add commit ID that caused it (#22583)
The `commit_id` property name is the same as equivalent functionality in GitHub. If the action was not caused by a commit, an empty string is used. This can for example be used to automatically add a Resolved label to an issue fixed by a commit, or clear it when the issue is reopened.
Diffstat (limited to 'modules/structs')
-rw-r--r--modules/structs/hook.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/structs/hook.go b/modules/structs/hook.go
index b722e32ca0..df5da6790f 100644
--- a/modules/structs/hook.go
+++ b/modules/structs/hook.go
@@ -352,6 +352,7 @@ type IssuePayload struct {
Issue *Issue `json:"issue"`
Repository *Repository `json:"repository"`
Sender *User `json:"sender"`
+ CommitID string `json:"commit_id"`
}
// JSONPayload encodes the IssuePayload to JSON, with an indentation of two spaces.
@@ -386,6 +387,7 @@ type PullRequestPayload struct {
PullRequest *PullRequest `json:"pull_request"`
Repository *Repository `json:"repository"`
Sender *User `json:"sender"`
+ CommitID string `json:"commit_id"`
Review *ReviewPayload `json:"review"`
}