Merge pull request #97 from Toshik1978/v5

Fixed pipeline hook for GitLab >= 12.3
This commit is contained in:
Dean Karn
2019-11-11 12:53:47 -08:00
committed by GitHub
+21 -6
View File
@@ -104,12 +104,12 @@ type WikiPageEventPayload struct {
// PipelineEventPayload contains the information for GitLab's pipeline status change event // PipelineEventPayload contains the information for GitLab's pipeline status change event
type PipelineEventPayload struct { type PipelineEventPayload struct {
ObjectKind string `json:"object_kind"` ObjectKind string `json:"object_kind"`
User User `json:"user"` User User `json:"user"`
Project Project `json:"project"` Project Project `json:"project"`
Commit Commit `json:"commit"` Commit Commit `json:"commit"`
ObjectAttributes ObjectAttributes `json:"object_attributes"` ObjectAttributes PipelineObjectAttributes `json:"object_attributes"`
Jobs []Job `json:"jobs"` Jobs []Job `json:"jobs"`
} }
// CommentEventPayload contains the information for GitLab's comment event // CommentEventPayload contains the information for GitLab's comment event
@@ -356,6 +356,21 @@ type ObjectAttributes struct {
Assignee Assignee `json:"assignee"` Assignee Assignee `json:"assignee"`
} }
// PipelineObjectAttributes contains pipeline specific GitLab object attributes information
type PipelineObjectAttributes struct {
ID int64 `json:"id"`
Ref string `json:"ref"`
Tag bool `json:"tag"`
SHA string `json:"sha"`
BeforeSHA string `json:"before_sha"`
Source string `json:"source"`
Status string `json:"status"`
Stages []string `json:"stages"`
CreatedAt customTime `json:"created_at"`
FinishedAt customTime `json:"finished_at"`
Duration int64 `json:"duration"`
}
// Position defines a specific location, identified by paths line numbers and // Position defines a specific location, identified by paths line numbers and
// image coordinates, within a specific diff, identified by start, head and // image coordinates, within a specific diff, identified by start, head and
// base commit ids. // base commit ids.