Forked from hubertursua/setup github issues labels.sh
Last active
August 22, 2017 14:23
-
-
Save joseph-allen/3831388e5e7978dfe34a4813d9cf4ffe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo -n "GitHub User: " | |
read USER | |
echo -n "GitHub Password: " | |
read -s PASS | |
echo "" | |
echo -n "GitHub Repo (e.g. foo/bar): " | |
read REPO | |
REPO_USER=$(echo "$REPO" | cut -f1 -d /) | |
REPO_NAME=$(echo "$REPO" | cut -f2 -d /) | |
# Delete default labels | |
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/invalid" | |
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/question" | |
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/wontfix" | |
# Create labels | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"discussion","color":"cc317c"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"enhancement","color":"84b6eb"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"environment","color":"fad8c7"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"test","color":"fad8c7"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"feature","color":"91ca55"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"techdebt","color":"d93f0b"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment