add CI notes

This commit is contained in:
openoms
2022-09-28 15:12:26 +01:00
parent d8f465cb97
commit 4532229555

21
ci/README.md Normal file
View File

@@ -0,0 +1,21 @@
# CI notes
## Delete workflow runs
```
OWNER=
REPO=
# list workflow ids
gh api -X GET /repos/$OWNER/$REPO/actions/workflows | jq '.workflows[] | .name,.id'
WORKFLOW_ID=
# list runs
gh api -X GET /repos/$OWNER/$REPO/actions/workflows/$WORKFLOW_ID/runs | jq '.workflow_runs[] | .id' | tail -n 10
# delete oldest 10 workflows (won't delete the running one)
gh api -X GET /repos/$OWNER/$REPO/actions/workflows/$WORKFLOW_ID/runs | jq '.workflow_runs[] | .id' | tail -n 10 | xargs -I{} gh api -X DELETE /repos/$OWNER/$REPO/actions/runs/{}
# delete newest 10 workflows (won't delete the running one)
gh api -X GET /repos/$OWNER/$REPO/actions/workflows/$WORKFLOW_ID/runs | jq '.workflow_runs[] | .id' | head -n 10 | xargs -I{} gh api -X DELETE /repos/$OWNER/$REPO/actions/runs/{}