Skip to content

Instantly share code, notes, and snippets.

@saade
Created July 14, 2021 15:02
Show Gist options
  • Save saade/666493b9cc05ab28de5f7766e36157ed to your computer and use it in GitHub Desktop.
Save saade/666493b9cc05ab28de5f7766e36157ed to your computer and use it in GitHub Desktop.
Delete all workflow runs
user=GH_USERNAME repo=REPO_NAME; gh api repos/$user/$repo/actions/runs \
--paginate -q '.workflow_runs[] | select(.head_branch != "master") | "\(.id)"' | \
xargs -n1 -I % gh api repos/$user/$repo/actions/runs/% -X DELETE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment