Delete old workflow results

I have the same issue than above and good news, it have been fixed ! I could delete all previously failed job !

Thank GitHub team !

This is correct. Once all run of a workflow are deleted, the workflow no longer shows in the Actions tab.

There is probably some bug in my repository: https://github.com/atlassian-labs/atlassian-slack-integration-server/actions?query=workflow%3A.github%2Fworkflows%2Fbug.yml. It says there is “1 result” and “No results matched your search” in the same time.

Any ideas how I can fix it?

2 Likes

I ran into the same issue. Turned out that the workflow run still existed in all workflows. Try deleting it from there, it worked for me.

1 Like

I have 331 workflow runs so looking for a “Delete All Workflow runs” option…

Huh, this did the trick. Thank you! I don’t quite understand what is going on here though. What makes a workflow appear only under All workflows? Is it just a sporadical bug?

Glad to help!
Me neither. I think it’s probably a bug since this behavior doesn’t make much sense :confused:

I believe you can use GitHub REST API for this.

If you employ GitHub CLI and jq, you can do something like below, to delete all workflow runs e.g. triggered not from master (adjust select operator in jq as necessary for other criteria):

gh api repos/username/reponame/actions/runs \
| jq -r '.workflow_runs[] | select(.head_branch != "master") | "\(.id)"' \
| xargs -n1 -J % gh api repos/username/reponame/actions/runs/% -X DELETE
2 Likes

Awesome!

Use -I instead of -J if you have GNU xargs, as it doesn’t have -J.