Created
September 11, 2023 22:20
-
-
Save Mossman1215/8f5cf7bb26c197bf0d02795493cd28da to your computer and use it in GitHub Desktop.
delete actions runs logs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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