Last active
January 28, 2016 13:44
-
-
Save ivanbarlog/75ea8ea7a802764f6121 to your computer and use it in GitHub Desktop.
Adding github labels via bash script
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 | |
read -p "repository (owner/repository): " REPO | |
read -p "user: " USER | |
read -p "password: " -s PASS | |
# Delete default labels | |
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$REPO/labels/bug" | |
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$REPO/labels/duplicate" | |
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$REPO/labels/enhancement" | |
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$REPO/labels/invalid" | |
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$REPO/labels/question" | |
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$REPO/labels/wontfix" | |
# Create labels | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"0 - onhold","color":"fbca04"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"1 - queue","color":"444444"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"2 - indev","color":"00aaee"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"3 - dev-OK","color":"006b75"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"4 - test","color":"ffff22"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"4 - test by dev","color":"ffff22"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"5 - test-OK","color":"eb6420"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"6 - UAT","color":"ffbb66"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"7 - UAT-OK","color":"009800"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"8 - live","color":"02e10c"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"adm","color":"33ffcc"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"cli","color":"ffdd99"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"des","color":"e102d8"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"dev","color":"0b02e1"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"failed","color":"ff2233"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"man","color":"d7e102"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"p:1","color":"ff0000"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"p:2","color":"ffff00"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"p:3","color":"00eeee"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"p:blocker","color":"330044"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"s:L","color":"cc1111"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"s:M","color":"ccff22"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"s:S","color":"00ff44"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"s:XL","color":"330077"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"s:XS","color":"ff44aa"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"s:XXS","color":"fad8c7"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"t:bug","color":"fc2929"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"t:enhancement","color":"c7def8"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"t:feature","color":"cccccc"}' "https://api.github.com/repos/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"t:question","color":"cc317c"}' "https://api.github.com/repos/$REPO/labels" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment