| 243 | } |
| 244 | |
| 245 | async runners(opts = {}) { |
| 246 | const endpoint = `/runners?per_page=100`; |
| 247 | const runners = await this.request({ endpoint, method: 'GET' }); |
| 248 | return await Promise.all( |
| 249 | runners.map(async ({ id, description, online }) => ({ |
| 250 | id, |
| 251 | name: description, |
| 252 | busy: |
| 253 | ( |
| 254 | await this.request({ |
| 255 | endpoint: `/runners/${id}/jobs`, |
| 256 | method: 'GET' |
| 257 | }) |
| 258 | ).filter((job) => job.status === 'running').length > 0, |
| 259 | labels: ( |
| 260 | await this.request({ endpoint: `/runners/${id}`, method: 'GET' }) |
| 261 | ).tag_list, |
| 262 | online |
| 263 | })) |
| 264 | ); |
| 265 | } |
| 266 | |
| 267 | async runnerById({ id } = {}) { |
| 268 | const { |