coop-cloud-git-redirect/scripts/gitea-delete-org-repos.sh

16 lines
381 B
Bash
Raw Normal View History

2024-05-31 02:54:02 +00:00
#!/bin/bash
echo "Deleting repos in: $1"
GITEA_TOKEN=e21ba81d24ea0cea298eca47d0437411def37c66
REPOS=$(http \
"https://git.coopcloud.tech/api/v1/orgs/$1/repos?limit=100" \
Authorization:"token $GITEA_TOKEN" \
| jq -r '.[].name')
for repo in $REPOS; do
echo "$repo"
http DELETE \
https://git.coopcloud.tech/api/v1/repos/$1/$repo \
Authorization:"token $GITEA_TOKEN"
done