( token: string, owner: string, repo: string, branchName: string )
| 572 | * Delete a branch after merge (cleanup). |
| 573 | */ |
| 574 | export async function deleteBranch( |
| 575 | token: string, |
| 576 | owner: string, |
| 577 | repo: string, |
| 578 | branchName: string |
| 579 | ): Promise<boolean> { |
| 580 | try { |
| 581 | const res = await ghFetch( |
| 582 | `/repos/${owner}/${repo}/git/refs/heads/${encodeURIComponent(branchName)}`, |
| 583 | token, |
| 584 | { method: 'DELETE' } |
| 585 | ); |
| 586 | return res.ok || res.status === 422; |
| 587 | } catch { |
| 588 | return false; |
| 589 | } |
| 590 | } |
| 591 | |
| 592 | // ══════════════════════════════════════════════════════════════════════ |
| 593 | // ── Galaxy Brain (GitHub Discussions via GraphQL API) ── |
no test coverage detected