GitHub API

PHOTO EMBED

Fri Mar 15 2024 13:52:13 GMT+0000 (Coordinated Universal Time)

Saved by @bmillot #git

# 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
content_copyCOPY