Anyone know a way to delete a workflow from GitHub Actions?

As of July 7, 2020, you can now delete the results of individual workflow runs. To do this, navigate to your workflow, find the workflow run that you want to delete, and select the "..." menu. In this menu, select "Delete workflow run".

The workflow run and its logs will be removed.

Delete workflow run

Currently, you must do this for each workflow run individually.

edit: As of 2021 Feb it seems that after all workflow runs are deleted the workflow it self disappears. One comment below also seems to confirm this.


It doesn't seem that there is currently a way to delete those workflows - this makes no sense - but it appears that once one makes the mistake of creating one they are stuck with it forever. The only solution so far I found is to disable these workflows.

So if I go to the Actions tab, I can then click on a workflow and disable it via [...] in the right top corner of that tab as in the snapshot below:

enter image description here

To delete all workflow results at once

To delete the records here is the solution I found here with slight modifications from the original:

user=GH_USERNAME repo=REPO_NAME; gh api repos/$user/$repo/actions/runs | \
jq -r '.workflow_runs[] | select(.head_branch != "master") | "\(.id)"' | \
xargs -n1 -I % gh api repos/$user/$repo/actions/runs/% -X DELETE

Replace GH_USERNAME and REPO_NAME with the desired github username and repo name correspondingly.

This will delete all the old workflows that aren't on the master branch. You can further tweak this to do what you need.

You will find the latest gh version here.

Note: For the final xargs part of the command chain - the original used -J instead of -I, which is not supported by GNU xargs. -J results in a single command, and -I will execute the command for each records, so it's a bit slower.

I also think it only gives a handful of records each time, so I had to run it 2 times to delete several pages of these workflow records.

Thank you to the OP on the community forum for sharing this in first place.


I managed to fix this (currently not possible via UI) by using "gh" CLI tool and reading REST API docs.

First, get all your workflows (these are the ones shown in the web UI -> Actions -> left column):

$ gh api repos/$YOUR_USER/$YOUR_REPO/actions/workflows
{
  "total_count": 2,
  "workflows": [
    {
      "id": 3611607,
      "name": "FreeBSD",
      ...
    },
    {
      "id": 4336318,
      "name": "MacOS",
      ...
    }
  ]
}

Use the ID of the workflow you want to delete (say 3611607) to get all of its individual runs:

$ gh api repos/$YOUR_USER/$YOUR_REPO/actions/workflows/3611607/runs
{
  "total_count": 17,
  "workflow_runs": [
    {
      "id": 363876785,
      "name": "FreeBSD",
      ...
    },
    {
      "id": 363876786,
      "name": "FreeBSD",
      ...
    },
    {
      "id": 363876787,
      "name": "FreeBSD",
      ...
    },
}

For each run id (let's say 363876785), delete it with:

$ gh api repos/$YOUR_USER/$YOUR_REPO/actions/runs/363876785 -X DELETE

After this, the undeletable Action in the left column of the web UI should disappear.