(opts = {})
| 293 | } |
| 294 | |
| 295 | async prCreate(opts = {}) { |
| 296 | const projectPath = await this.projectPath(); |
| 297 | const { source, target, title, description, skipCi, autoMerge } = opts; |
| 298 | |
| 299 | const prTitle = skipCi ? title + ' [skip ci]' : title; |
| 300 | const endpoint = `/projects/${projectPath}/merge_requests`; |
| 301 | const body = new URLSearchParams(); |
| 302 | body.append('source_branch', source); |
| 303 | body.append('target_branch', target); |
| 304 | body.append('title', prTitle); |
| 305 | body.append('description', description); |
| 306 | |
| 307 | const { web_url: url, iid } = await this.request({ |
| 308 | endpoint, |
| 309 | method: 'POST', |
| 310 | body |
| 311 | }); |
| 312 | |
| 313 | if (autoMerge) |
| 314 | await this.prAutoMerge({ pullRequestId: iid, mergeMode: autoMerge }); |
| 315 | return url; |
| 316 | } |
| 317 | |
| 318 | /** |
| 319 | * @param {{ pullRequestId: string }} param0 |
nothing calls this directly
no test coverage detected