Skip to content

Commit

Permalink
fix(gitlab): close MR instead of deleting it (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeijn authored Feb 5, 2022
1 parent c8b4ab8 commit af2c2d9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/scm/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,10 @@ func (g *Gitlab) MergePullRequest(ctx context.Context, pullReq scm.PullRequest)
func (g *Gitlab) ClosePullRequest(ctx context.Context, pullReq scm.PullRequest) error {
pr := pullReq.(pullRequest)

_, err := g.glClient.MergeRequests.DeleteMergeRequest(pr.targetPID, pr.iid, gitlab.WithContext(ctx))
stateEvent := "close"
_, _, err := g.glClient.MergeRequests.UpdateMergeRequest(pr.targetPID, pr.iid, &gitlab.UpdateMergeRequestOptions{
StateEvent: &stateEvent,
}, gitlab.WithContext(ctx))
if err != nil {
return err
}
Expand Down

0 comments on commit af2c2d9

Please sign in to comment.