Skip to content

Instantly share code, notes, and snippets.

@michaelsanford
Created October 13, 2021 04:16
Show Gist options
  • Select an option

  • Save michaelsanford/155db092767d5373ba8bce7ea98f4783 to your computer and use it in GitHub Desktop.

Select an option

Save michaelsanford/155db092767d5373ba8bce7ea98f4783 to your computer and use it in GitHub Desktop.

Revisions

  1. michaelsanford created this gist Oct 13, 2021.
    7 changes: 7 additions & 0 deletions batch-delete-github-workflow-runs.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    $user = "your user/org"
    $repo = "repo"

    (gh api repos/$user/$repo/actions/runs | ConvertFrom-Json).workflow_runs |
    %{ $_.id } |
    %{ gh api repos/$user/$repo/actions/runs/$_ -X DELETE }