(name: ImpactLabelName)
| 10565 | } |
| 10566 | |
| 10567 | function ensureImpactLabel(name: ImpactLabelName): void { |
| 10568 | const definition = IMPACT_LABELS.find((label) => label.name === name); |
| 10569 | if (!definition) return; |
| 10570 | try { |
| 10571 | ghWithRetry( |
| 10572 | [ |
| 10573 | "label", |
| 10574 | "create", |
| 10575 | definition.name, |
| 10576 | "--color", |
| 10577 | definition.color, |
| 10578 | "--description", |
| 10579 | definition.description, |
| 10580 | ], |
| 10581 | 2, |
| 10582 | ); |
| 10583 | } catch (error) { |
| 10584 | const message = error instanceof Error ? error.message : String(error); |
| 10585 | if (!/already exists/i.test(message)) throw error; |
| 10586 | } |
| 10587 | } |
| 10588 | |
| 10589 | function ensureMergeRiskLabel(name: MergeRiskLabelName): void { |
| 10590 | const definition = MERGE_RISK_LABELS.find((label) => label.name === name); |
no test coverage detected