Skip to content

Instantly share code, notes, and snippets.

@Mossman1215
Created September 11, 2023 22:20
Show Gist options
  • Save Mossman1215/8f5cf7bb26c197bf0d02795493cd28da to your computer and use it in GitHub Desktop.
Save Mossman1215/8f5cf7bb26c197bf0d02795493cd28da to your computer and use it in GitHub Desktop.
delete actions runs logs
#inspired by https://gist.github.com/gubatron/47552e1bfa345a142b2248be1925efb6#file-delete_github_workflow_run_logs-sh
#!/bin/bash -e
repo=reponame
user=username
WORKFLOW_RUN_IDS=$(gh api /repos/${user}/${repo}/actions/runs?per_page=999 | jq -r ".workflow_runs[] | [.id] | @tsv")
for id in ${WORKFLOW_RUN_IDS}
do
echo "Workflow ID: ${id}"
gh api -X DELETE "/repos/${user}/${repo}/actions/runs/${id}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment