Last active
October 28, 2018 22:33
-
-
Save prisis/a3ab21da35df608c83589e7a57b7f13a to your computer and use it in GitHub Desktop.
Narrowspark project labels
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 Repo (e.g. foo/bar): " | |
read REPO | |
# use this linke for the token https://github.com/settings/applications | |
TOKEN='' | |
REPO_USER=$(echo "$REPO" | cut -f1 -d /) | |
REPO_NAME=$(echo "$REPO" | cut -f2 -d /) | |
# Delete default labels | |
curl --user "$TOKEN:" --include --request DELETE "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/bug" | |
curl --user "$TOKEN:" --include --request DELETE "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/duplicate" | |
curl --user "$TOKEN:" --include --request DELETE "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/enhancement" | |
curl --user "$TOKEN:" --include --request DELETE "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/invalid" | |
curl --user "$TOKEN:" --include --request DELETE "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/question" | |
curl --user "$TOKEN:" --include --request DELETE "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/wontfix" | |
curl --user "$TOKEN:" --include --request DELETE "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/good%20first%20issue" | |
curl --user "$TOKEN:" --include --request DELETE "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/help%20wanted" | |
# Create labels | |
curl --user "$TOKEN:" --include --request POST --data '{"name":"Deprecated","description":"Changelog Deprecated","color":"1d76db"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$TOKEN:" --include --request POST --data '{"name":"Fixed","description":"Changelog Fixed","color":"9ef42e"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$TOKEN:" --include --request POST --data '{"name":"Removed","description":"Changelog Removed","color":"e99695"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$TOKEN:" --include --request POST --data '{"name":"Security","description":"Changelog Security","color":"ed3e3b"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$TOKEN:" --include --request POST --data '{"name":"Added","description":"Changelog Added","color":"90db3f"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$TOKEN:" --include --request POST --data '{"name":"Changed","description":"Changelog Changed","color":"fbca04"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$TOKEN:" --include --request POST --data '{"name":"Enhancement","color":"d7e102"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$TOKEN:" --include --request POST --data '{"name":"Duplicate","color":"000000"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$TOKEN:" --include --request POST --data '{"name":"Status: Good first issue","color":"d7e102"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$TOKEN:" --include --request POST --data '{"name":"Status: Help wanted","color":"85d84e"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$TOKEN:" --include --request POST --data '{"name":"Status: Needs Work","color":"fad8c7"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$TOKEN:" --include --request POST --data '{"name":"Status: Reviewed","color":"bfe5bf"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$TOKEN:" --include --request POST --data '{"name":"Status: Waiting for feedback","color":"fef2c0"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$TOKEN:" --include --request POST --data '{"name":"Type: BC Break","color":"b60205"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$TOKEN:" --include --request POST --data '{"name":"Type: Bug","color":"b60205"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$TOKEN:" --include --request POST --data '{"name":"Type: Critical","color":"ff8c00"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$TOKEN:" --include --request POST --data '{"name":"Type: RFC","color":"fbca04"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$TOKEN:" --include --request POST --data '{"name":"Type: Unconfirmed","color":"444444"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
curl --user "$TOKEN:" --include --request POST --data '{"name":"Type: Wontfix","color":"000000"}' "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