Last active
May 15, 2022 09:28
-
-
Save pcheliniy/7f89f2ea2dcf57f06a7124a232143a3e to your computer and use it in GitHub Desktop.
Remove dangling gh actions
This file contains hidden or 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
myorg=pcheliniy | |
repo=chartrepo | |
### get wf ids, names, paths | |
gh api repos/${myorg}/${repo}/actions/workflows | jq -r '.workflows | .[] | .id, .name, .path, []' | |
wf_id=123456789 | |
### remove runs history | |
gh api repos/${myorg}/${repo}/actions/workflows/${wf_id}/runs | jq -r '.workflow_runs | .[] | .id' | while read line; do | |
gh api repos/${myorg}/${repo}/actions/runs/$line -X DELETE; | |
done | |
### when you remove all previous runs of the job, removed jobs will disappeared |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment