From e2834a3b51f361fa399f2f4c2098ffd8cf319386 Mon Sep 17 00:00:00 2001 From: Roy Cornelissen Date: Mon, 2 Dec 2024 15:43:18 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20cleanup=20steps=20for=20co?= =?UTF-8?q?despaces?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 416e90e..13b8757 100644 --- a/README.md +++ b/README.md @@ -30,3 +30,17 @@ for repo in $(gh repo list XpiritCommunityEvents --json name --jq '.[].name | se gh repo delete "XpiritCommunityEvents/$repo" --yes done ``` +Find all codespaces: + +```bash +gh codespace list -o XpiritCommunityEvents --json name,repository > codespaces.json +``` + +Cleaning them op: + +```bash +jq -r 'map(select(.repository | test("^XpiritCommunityEvents/attendeello")) | .repository)' codespaces.json | while read repo; do + echo "Deleting codespace for repository: $repo" + gh codespace delete --repo "$repo" --force +done +```