Forked from rentzsch/setup github issues labels.sh
Last active
July 21, 2016 22:12
-
-
Save cgrusden/d39d4fc46b06e218edb4569682b6bd2e to your computer and use it in GitHub Desktop.
Shell script to set up a GitHub Project's Issues' Labels as described in <http://rentzsch.tumblr.com/post/252878320/my-lighthouse-ticket-settings-with-colors>.WARNING: script assumes a newish project that hasn't really used labels yet. It deletes all default labels, which means DATA LOSS if you've used them for anything.
This file contains hidden or 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
USER= | |
PASS= | |
REPO= | |
ACCOUNT=sofetch | |
# Delete default labels | |
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$ACCOUNT/$REPO/labels/bug" | |
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$ACCOUNT/$REPO/labels/duplicate" | |
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$ACCOUNT/$REPO/labels/enhancement" | |
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$ACCOUNT/$REPO/labels/invalid" | |
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$ACCOUNT/$REPO/labels/question" | |
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$ACCOUNT/$REPO/labels/wontfix" | |
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$ACCOUNT/$REPO/labels/help%20wanted" | |
# Create labels | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"0-backlog","color":"c5def5"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"1-in-progress","color":"c5def5"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"2-in-review","color":"c5def5"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"3-reviewed","color":"c5def5"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"4-in-staging","color":"c5def5"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"5-staging-testing","color":"c5def5"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"6-staging-tested","color":"c5def5"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"7-in-production","color":"c5def5"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"8-production-testing","color":"c5def5"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"9-production-tested","color":"c5def5"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"10-questions/blocked","color":"c5def5"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"p1-low","color":"fef2c0"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"p2-medium","color":"fbca04"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"p3-high","color":"d93f0b"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"p4-highest","color":"0e8a16"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"t-airbrake","color":"006b75"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"t-bug","color":"006b75"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"t-migration","color":"006b75"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"t-new-feature","color":"006b75"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" | |
curl --user "$USER:$PASS" --include --request POST --data '{"name":"t-refactor","color":"006b75"}' "https://api.github.com/repos/$ACCOUNT/$REPO/labels" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment