Skip to content

Commit 9e8b4ca

Browse files
authored
Merge pull request #306 from drone/gitlabsha
[feat]: [CI-12179]: Add support for gitlab basesha for PRs
2 parents 0a0caf1 + 1cd57db commit 9e8b4ca

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scm/driver/gitlab/pr.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ type pr struct {
117117
Updated time.Time `json:"updated_at"`
118118
Closed time.Time
119119
Labels []string `json:"labels"`
120+
DiffRefs struct {
121+
BaseSha string `json:"base_sha"`
122+
HeadSha string `json:"head_sha"`
123+
StartSha string `json:"start_sha"`
124+
} `json:"diff_refs"`
120125
}
121126

122127
type changes struct {
@@ -165,6 +170,9 @@ func convertPullRequest(from *pr) *scm.PullRequest {
165170
Created: from.Created,
166171
Updated: from.Updated,
167172
Labels: labels,
173+
Base: scm.Reference{
174+
Sha: from.DiffRefs.BaseSha,
175+
},
168176
}
169177
}
170178

0 commit comments

Comments
 (0)