mirror of https://github.com/harness/drone.git
fix: [CODE-2583]: fix dry-running merge without merge method (#2852)
* fix: [CODE-2583]: fix dry-running merge without merge methodpull/3576/head
parent
32e817888a
commit
7b5490ac10
|
@ -102,9 +102,15 @@ func (c *Controller) Merge(
|
||||||
pullreqNum int64,
|
pullreqNum int64,
|
||||||
in *MergeInput,
|
in *MergeInput,
|
||||||
) (*types.MergeResponse, *types.MergeViolations, error) {
|
) (*types.MergeResponse, *types.MergeViolations, error) {
|
||||||
|
// keep track of original method in case it's empty, as it is optional for dry-run.
|
||||||
|
originalMergeMethod := in.Method
|
||||||
if err := in.sanitize(); err != nil {
|
if err := in.sanitize(); err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
if originalMergeMethod != "" {
|
||||||
|
// use sanitized version if a non-empty merge method was provided.
|
||||||
|
originalMergeMethod = in.Method
|
||||||
|
}
|
||||||
|
|
||||||
requiredPermission := enum.PermissionRepoPush
|
requiredPermission := enum.PermissionRepoPush
|
||||||
if in.DryRun {
|
if in.DryRun {
|
||||||
|
@ -212,7 +218,7 @@ func (c *Controller) Merge(
|
||||||
SourceRepo: sourceRepo,
|
SourceRepo: sourceRepo,
|
||||||
PullReq: pr,
|
PullReq: pr,
|
||||||
Reviewers: reviewers,
|
Reviewers: reviewers,
|
||||||
Method: in.Method,
|
Method: originalMergeMethod,
|
||||||
CheckResults: checkResults,
|
CheckResults: checkResults,
|
||||||
CodeOwners: codeOwnerWithApproval,
|
CodeOwners: codeOwnerWithApproval,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue