Skip to content

Commit

Permalink
Feat/gitlab support2 (#1609)
Browse files Browse the repository at this point in the history
* provide gitlab fixes
  • Loading branch information
motatoes authored Jul 8, 2024
1 parent 1947ca1 commit fe99252
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion libs/ci/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,16 @@ func (gitlabService GitLabService) MergePullRequest(mergeRequestID int) error {
}

func (gitlabService GitLabService) IsMergeable(mergeRequestID int) (bool, error) {
return gitlabService.Context.IsMeargeable, nil
opt := &go_gitlab.GetMergeRequestsOptions{}
mergeRequest, _, err := gitlabService.Client.MergeRequests.GetMergeRequest(*gitlabService.Context.ProjectId, *gitlabService.Context.MergeRequestIId, opt)
if err != nil {
log.Printf("could not get gitlab mergability status %v", err)
return false, fmt.Errorf("could not get gitlab mergability status: %v", err)
}
if mergeRequest.DetailedMergeStatus == "mergeable" {
return true, nil
}
return false, nil
}

func (gitlabService GitLabService) IsClosed(mergeRequestID int) (bool, error) {
Expand Down

0 comments on commit fe99252

Please sign in to comment.