From 4532229555c111f73a24d1f80f1550b6ca6686ce Mon Sep 17 00:00:00 2001 From: openoms Date: Wed, 28 Sep 2022 15:12:26 +0100 Subject: [PATCH] add CI notes --- ci/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ci/README.md diff --git a/ci/README.md b/ci/README.md new file mode 100644 index 0000000..5bfe494 --- /dev/null +++ b/ci/README.md @@ -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/{}