While GitHub provides the ability to remove old workflow runs (https://github.blog/changelog/2020-07-07-github-actions-ability-to-delete-workflow-runs/), it fails to provide an option to delete all workflow runs for a particular workflow.
Manual deletion can become extremely tedious...
Turns out, this can be achieved using GitHub CLI (https://github.com/cli/cli), read on.
-
Idea initially noticed here: refined-github/refined-github#4838
-
Which brought me here: cli/cli#6449 where this solution in given:
gh run \ list --json databaseId -q '.[].databaseId' -w integration.yml --limit 500 \ | xargs -IID -P 15 \ gh api "repos/$(gh repo view --json nameWithOwner -q .nameWithOwner)/actions/runs/ID" \ -X DELETE
For posterity, here is the original message (the solution) posted by @fregante :