initial commit

This commit is contained in:
2025-10-23 09:21:23 -07:00
commit a243eae91a
7 changed files with 140 additions and 0 deletions

17
delete-gitea-projects.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
# BUG: need to repeat until all repos are gone...it's not getting all of them
source config.sh
for ((i=1; ; i+=1)); do
contents=$(curl -sX GET "${GT_DOMAIN}/api/v1/user/repos?limit=30&page=${i}" -H "Accept: application/json" -H "Authorization: token ${GT_TOKEN}")
if [ "$(echo $contents | jq -e '. | length == 0')" == "true" ]; then
break
fi
for repo in $(echo "$contents" | jq -r '.[].name')
do
echo $repo
curl -sX DELETE "${GT_DOMAIN}/api/v1/repos/${GT_USER}/${repo}" -H "Accept: application/json" -H "Authorization: token ${GT_TOKEN}"
done
done