On your repository page, go to the Actions tab, then open the DevTools console and run the code below:
document.querySelectorAll('div#partial-actions-workflow-runs a.Link--primary').forEach(async a => {
const url = a.href;
console.log(url);
const response = await fetch(url + '/delete', {
headers: {
'Accept': 'text/html',
'X-Requested-With': 'XMLHttpRequest'
}
});
if (response) {
const data = await response.text();
if (data) {
const doc = new DOMParser().parseFromString(data, "text/html");
if (doc) {
const input = doc.querySelector('input[name="authenticity_token"]');
if (input) {
const token = input.value;
await fetch(url, {
method: 'POST',
body: new URLSearchParams(`_method=delete&authenticity_token=${token}`)
});
}
}
}
}
});