Skip to content

Commit f248671

Browse files
committed
Fixed pipeline hook for GitLab >= 12.3
1 parent 2845fba commit f248671

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

gitlab/payload.go

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ type WikiPageEventPayload struct {
104104

105105
// PipelineEventPayload contains the information for GitLab's pipeline status change event
106106
type PipelineEventPayload struct {
107-
ObjectKind string `json:"object_kind"`
108-
User User `json:"user"`
109-
Project Project `json:"project"`
110-
Commit Commit `json:"commit"`
111-
ObjectAttributes ObjectAttributes `json:"object_attributes"`
112-
Jobs []Job `json:"jobs"`
107+
ObjectKind string `json:"object_kind"`
108+
User User `json:"user"`
109+
Project Project `json:"project"`
110+
Commit Commit `json:"commit"`
111+
ObjectAttributes PipelineObjectAttributes `json:"object_attributes"`
112+
Jobs []Job `json:"jobs"`
113113
}
114114

115115
// CommentEventPayload contains the information for GitLab's comment event
@@ -356,6 +356,21 @@ type ObjectAttributes struct {
356356
Assignee Assignee `json:"assignee"`
357357
}
358358

359+
// PipelineObjectAttributes contains pipeline specific GitLab object attributes information
360+
type PipelineObjectAttributes struct {
361+
ID int64 `json:"id"`
362+
Ref string `json:"ref"`
363+
Tag bool `json:"tag"`
364+
SHA string `json:"sha"`
365+
BeforeSHA string `json:"before_sha"`
366+
Source string `json:"source"`
367+
Status string `json:"status"`
368+
Stages []string `json:"stages"`
369+
CreatedAt customTime `json:"created_at"`
370+
FinishedAt customTime `json:"finished_at"`
371+
Duration int64 `json:"duration"`
372+
}
373+
359374
// Position defines a specific location, identified by paths line numbers and
360375
// image coordinates, within a specific diff, identified by start, head and
361376
// base commit ids.

0 commit comments

Comments
 (0)