Skip to content

Commit d2bc64b

Browse files
committed
Bugfix: optionally skip any merge request with no changes, regardless of opened/closed/merged state
1 parent 7ae35fa commit d2bc64b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

project.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,8 @@ func (p *project) migrateMergeRequest(ctx context.Context, mergeRequest *gitlab.
576576
Draft: &mergeRequest.Draft,
577577
}
578578
if pullRequest, _, err = gh.PullRequests.Create(ctx, p.githubPath[0], p.githubPath[1], &newPullRequest); err != nil {
579-
if mergeRequest.State == "closed" && strings.Contains(err.Error(), "No commits between") {
580-
logger.Debug("skipping closed merge request as the change is already present in trunk branch", "owner", p.githubPath[0], "repo", p.githubPath[1], "merge_request_id", mergeRequest.IID)
579+
if strings.Contains(err.Error(), "No commits between") {
580+
logger.Debug("skipping merge request as the change is already present in trunk branch", "owner", p.githubPath[0], "repo", p.githubPath[1], "merge_request_id", mergeRequest.IID)
581581
return false, nil
582582
}
583583
return false, fmt.Errorf("creating pull request: %v", err)

0 commit comments

Comments
 (0)