Is there a way to delete or hide old/renamed Workflows?

Click on “…” and then “Delete workflow run”:

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?)

1 Like

@Simran-B After doing that I have this:

The YAML file is long gone. There seems to be no way of removing these workflows from the repo.

@Cabalist You are using a filter workflow:"Black Style" . Remove it by clicking on [x] or click All workflows on the left hand side:

image

Then go through the list of workflow runs and delete all that are related to your former workflow.

@Simran-B Thanks for your response. :slight_smile: 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…

I know, it finds results but doesn’t list the workflow runs. This appears to be a bug.

2 Likes

Same problem here:

  • I renamed the yml file 2 times (don’t need them anymore, they’re gone/deleted now)
  • they still appear in the UI
  • I deleted all old runs associated with those 2 yml files
  • they still appear in the UI
  • I disabled them from the UI
  • they still appear in the UI
1 Like

I put together a (scriptable) solution here: https://stackoverflow.com/a/65374631/376587

2 Likes

This is the best solution.

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/{}
7 Likes

Crazy that it’s two years later almost and no native fix.

2 Likes

@github/@ethomson any chance you’re going to come back and really solve this?

Are we in the future yet where this functionality exists?

1 Like

Any update about this issue?

This doesn’t seem to have been solved after all, unless I’m missing something.

so when is this going to be a thing? I have like 5 workflows with the same name due to file name changes and we need to delete them.

I certainly don’t want to go through and delete 800 records in order to make the workflow disappear

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.

9 Likes

I created an account here just to upvote your comment. It made my day after being a bit sad about having to delete 800 runs to have a clean view.

Any updates on this?

It’s been 4 years and we still have to click through hundreds of times to clean up unused / stale workflows.

@sammcj As previous commenters have suggested, you can use the web API (with curl) or the gh CLI as a workaround.

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.