Clean up GitHub workflow runs in terminal
Delete all GitHub workflow runs in terminal using gh cli command
Delete all GitHub workflow runs for an action in the terminal using gh cli command.
Replace ${action.yml} with the filename of the workflow you need to run
for id in $(gh run list --workflow ${action.yml} --json databaseId --jq '.[].databaseId'); do gh run delete "$id"; done
This help to cleanup when you want to rename a GitHub action and cleanup the previous action from the All workflows section