Skip to content

Instantly share code, notes, and snippets.

@guibranco
Created August 5, 2026 09:45
Show Gist options
  • Select an option

  • Save guibranco/3fc555b1938efdcb94a0b3acd4353eda to your computer and use it in GitHub Desktop.

Select an option

Save guibranco/3fc555b1938efdcb94a0b3acd4353eda to your computer and use it in GitHub Desktop.
Delete workflow/actions runs
OWNER=guibranco
REPO=blog
WF=248922293
gh api --paginate \
"repos/$OWNER/$REPO/actions/workflows/$WF/runs?status=completed&per_page=100" \
--jq '.workflow_runs[].id' > run_ids.txt
wc -l run_ids.txt
while read -r id; do
gh run delete "$id" --repo "$OWNER/$REPO" \
&& echo "deleted $id" || echo "skip $id"
sleep 0.3
done < run_ids.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment