# Delete the logs of first 1000 actions related to a workflow from the server

WORKFLOW="My workflow name"
OWNER="owner"
REPOSITORY="repo"

gh run list --repo "$OWNER/$REPOSITORY" -w "$WORKFLOW" --limit 1000 --json databaseId \
| jq '.[].databaseId' \
| xargs -I{} gh api -X DELETE /repos/$OWNER/$REPOSITORY/actions/runs/{}/logs