(opts = {})
| 103 | } |
| 104 | |
| 105 | async commitPrs(opts = {}) { |
| 106 | const { commitSha } = opts; |
| 107 | |
| 108 | const projectPath = await this.projectPath(); |
| 109 | |
| 110 | const endpoint = `/projects/${projectPath}/repository/commits/${commitSha}/merge_requests`; |
| 111 | const prs = await this.request({ endpoint, method: 'GET' }); |
| 112 | |
| 113 | return prs |
| 114 | .filter((pr) => pr.state === 'opened') |
| 115 | .map((pr) => { |
| 116 | const { |
| 117 | web_url: url, |
| 118 | source_branch: source, |
| 119 | target_branch: target |
| 120 | } = pr; |
| 121 | return { |
| 122 | url, |
| 123 | source, |
| 124 | target |
| 125 | }; |
| 126 | }); |
| 127 | } |
| 128 | |
| 129 | async checkCreate() { |
| 130 | throw new Error('Gitlab does not support check!'); |
no test coverage detected