From 9afd42565e67bd16d29f1955de73734be6ea1f79 Mon Sep 17 00:00:00 2001 From: Vadim Peretokin Date: Fri, 28 Nov 2025 09:31:13 +0100 Subject: [PATCH] Add manual branch deletion feature Closes #48 --- dashboard/builds.html | 43 +++++++++++++++-- images/ci-build/Dockerfile | 5 +- images/ci-build/delete-branch | 36 +++++++++++++++ images/ig-publisher/Dockerfile | 1 + images/ig-publisher/ci-files/delete | 3 ++ triggers/ig-commit-trigger/delete-job.json | 54 ++++++++++++++++++++++ triggers/ig-commit-trigger/index.js | 44 +++++++++++++++++- 7 files changed, 177 insertions(+), 9 deletions(-) create mode 100644 images/ci-build/delete-branch create mode 100644 images/ig-publisher/ci-files/delete create mode 100644 triggers/ig-commit-trigger/delete-job.json diff --git a/dashboard/builds.html b/dashboard/builds.html index 0e3e1544..7e57f6dc 100644 --- a/dashboard/builds.html +++ b/dashboard/builds.html @@ -176,6 +176,31 @@

FHIR IG Builds

}) } + const deleted = [] + function deleteBranch(branchnum, org, repo, branch) { + if (deleted.includes(branchnum)) { + return; + } + if (!confirm(`Delete branch "${branch}" from ${org}/${repo}? This cannot be undone.`)) { + return; + } + deleted.push(branchnum) + document.getElementById(`delete-branch-${branchnum}`).classList.add("text-muted"); + fetch("https://us-central1-fhir-org-starter-project.cloudfunctions.net/ig-commit-trigger", { + body: JSON.stringify({ + "action": "delete", + "ref": `refs/heads/${branch}`, + "repository": {"full_name": `${org}/${repo}`} + }), + headers: { + 'Content-Type': 'application/json' + }, + method: 'POST', + referrer: 'no-referrer', + mode: 'cors' + }) + } + function render({builds, qas}){ const sorter = (a, b) => { @@ -252,14 +277,22 @@

FHIR IG Builds

${date ? timeFormatter.format(date) : "???"} ${success ? "success" : "failure"} - -