-
-
Save sushihangover/fa05be94ce15306a25af to your computer and use it in GitHub Desktop.
Make the default GitHub issue labels a little nicer.
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
function getpassword() { | |
# Written for Mac OS X Keychain. | |
SERVICE=$1 | |
ACCOUNT=$2 | |
security find-internet-password -s $SERVICE -a $ACCOUNT -w | tr -d '\n' | |
} | |
function update_github_issues() { | |
read -p "Enter the repo owner: " OWNER | |
read -p "Enter the repo name: " REPO | |
GITHUB_ACCESS_TOKEN=`getpassword "api.github.com" "GitHub"` | |
ENDPOINT="https://api.github.com/repos/$OWNER/$REPO/labels" | |
# Add New Labels | |
curl -X POST -d '{"name": "tweak", "color": "5fb3fc"}' $ENDPOINT?access_token=$GITHUB_ACCESS_TOKEN | |
curl -X POST -d '{"name": "needs more info", "color": "575473"}' $ENDPOINT?access_token=$GITHUB_ACCESS_TOKEN | |
# Delete Labels We Won't Use | |
curl -X DELETE $ENDPOINT/invalid?access_token=$GITHUB_ACCESS_TOKEN | |
curl -X DELETE $ENDPOINT/wontfix?access_token=$GITHUB_ACCESS_TOKEN | |
# Update Colors For Existing Labels | |
curl -X PATCH -d '{"name": "tweak", "color": "5fb3fc"}' $ENDPOINT/tweak?access_token=$GITHUB_ACCESS_TOKEN | |
curl -X PATCH -d '{"name": "needs more info", "color": "575473"}' "$ENDPOINT/needs%20more%20info?access_token=$GITHUB_ACCESS_TOKEN" | |
curl -X PATCH -d '{"name": "enhancement", "color": "1a97fc"}' $ENDPOINT/enhancement?access_token=$GITHUB_ACCESS_TOKEN | |
curl -X PATCH -d '{"name": "question", "color": "f9d29d"}' $ENDPOINT/question?access_token=$GITHUB_ACCESS_TOKEN | |
curl -X PATCH -d '{"name": "bug", "color": "f8579a"}' $ENDPOINT/bug?access_token=$GITHUB_ACCESS_TOKEN | |
curl -X PATCH -d '{"name": "duplicate", "color": "575473"}' "$ENDPOINT/duplicate?access_token=$GITHUB_ACCESS_TOKEN" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment