(body)
| 143 | } |
| 144 | |
| 145 | async runnerToken(body) { |
| 146 | const projectPath = await this.projectPath(); |
| 147 | const legacyEndpoint = `/projects/${projectPath}`; |
| 148 | const endpoint = `/user/runners`; |
| 149 | |
| 150 | const { id, runners_token: runnersToken } = await this.request({ |
| 151 | endpoint: legacyEndpoint |
| 152 | }); |
| 153 | |
| 154 | if (runnersToken === null) { |
| 155 | if (!body) body = new URLSearchParams(); |
| 156 | body.append('project_id', id); |
| 157 | body.append('runner_type', 'project_type'); |
| 158 | return (await this.request({ endpoint, method: 'POST', body })).token; |
| 159 | } |
| 160 | |
| 161 | return runnersToken; |
| 162 | } |
| 163 | |
| 164 | async registerRunner(opts = {}) { |
| 165 | const { tags, name } = opts; |
no test coverage detected