Skip to content

Commit

Permalink
Merge pull request #306 from drone/gitlabsha
Browse files Browse the repository at this point in the history
[feat]: [CI-12179]: Add support for gitlab basesha for PRs
  • Loading branch information
smjt-h committed May 9, 2024
2 parents 0a0caf1 + 1cd57db commit 9e8b4ca
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scm/driver/gitlab/pr.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ type pr struct {
Updated time.Time `json:"updated_at"`
Closed time.Time
Labels []string `json:"labels"`
DiffRefs struct {
BaseSha string `json:"base_sha"`
HeadSha string `json:"head_sha"`
StartSha string `json:"start_sha"`
} `json:"diff_refs"`
}

type changes struct {
Expand Down Expand Up @@ -165,6 +170,9 @@ func convertPullRequest(from *pr) *scm.PullRequest {
Created: from.Created,
Updated: from.Updated,
Labels: labels,
Base: scm.Reference{
Sha: from.DiffRefs.BaseSha,
},
}
}

Expand Down

0 comments on commit 9e8b4ca

Please sign in to comment.