Make sure you delete all runs to get the workflow name off the list. There must not be any runs remaining - check the “All workflows” view, sometimes the runs are gone from the filtered list, but still under “All workflows” (bug?)
@Simran-B Thanks for your response. If I click All Workflows I still see it listed. I had clicked on it in order to filter to try and delete those. If you look at my original screenshot you can see it says “2 results” and yet nothing is there. ^ This is a screenshot fo it in the workflows list.
EDIT: I was able to remove it by manually looking through previous branches (branches I had otherwise deleted) and finding it. The filter was not returning all occurrences of this Workflows run! I have thousands of runs. I was lucky it was recent…
Here’s a few commands to quickly clean up your workflows.
You’ll need the xargs, gh and jq CLI tools.
Depending on how many runs you have you’ll have to execute the delete step multiple times because the GH API endpoints are paginated.
OWNER=<your user/org name>
REPO=<repo name>
# list workflows
gh api -X GET /repos/$OWNER/$REPO/actions/workflows | jq '.workflows[] | .name,.id'
# copy the ID of the workflow you want to clear and set it
WORKFLOW_ID=<workflow id>
# list runs
gh api -X GET /repos/$OWNER/$REPO/actions/workflows/$WORKFLOW_ID/runs | jq '.workflow_runs[] | .id'
# delete all runs
gh api -X GET /repos/$OWNER/$REPO/actions/workflows/$WORKFLOW_ID/runs | jq '.workflow_runs[] | .id' | xargs -I{} gh api -X DELETE /repos/$OWNER/$REPO/actions/runs/{}
Ah, September 2019. So much has happened since then. We’ve all gotten older, wiser, and perhaps a bit sadder. Yet amidst all the upheaval out there in the world, we can still find comfort in the fact that our old friends, those misbegotten workflows that long ago moved on to a better place, still smile back at us every time we hit the Actions tab.
Thanks yes I’m aware but it’s not a good workaround, it’s hacky, takes time and not everyone is capable of doing it. It’s a right pain when you have many repos and it seems like something pretty fundamental GitHub should fix.