- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgithub-delete.sh
More file actions
Latest commit
executable file
·13 lines (12 loc) · 528 Bytes
/
Copy pathgithub-delete.sh
File metadata and controls
executable file
·13 lines (12 loc) · 528 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash
ORG="$1"
REPO="$2"
AUTHENTICATION_API_TOKEN="${GITHUB_AUTH_TOKEN:?"must be set and non-empty"}:x-oauth-basic"
read -r -p "Are you sure you want to delete \"$REPO\" repository from \"$1\" on github? [y/N] " response
if [[ $response=~ ^([yY][eE][sS]|[yY])$ ]]
then
curl -u $AUTHENTICATION_API_TOKEN -X DELETE https://api.github.com/repos/${ORG:?"must be set and non-empty"}/${REPO:?"must be set and non-empty"}
echo"Repository \"$REPO\" deleted"
else
echo"You must answer yes to continue. Aborting."
fi