Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bhubbard/ce61ee7be7907e4946caaeb77fdf353e to your computer and use it in GitHub Desktop.
Save bhubbard/ce61ee7be7907e4946caaeb77fdf353e to your computer and use it in GitHub Desktop.
#!/bin/bash
echo -n "GitHub User: "
read USER
echo -n "GitHub Password: "
read -s PASS
echo ""
echo -n "GitHub Repo (e.g. imFORZA/REPO): "
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/bug"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/duplicate"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/enhancement"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/help%20wanted"
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 [PRIORITY]
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[PRIORITY] HIGH","color":"DD1E25"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[PRIORITY] MEDIUM","color":"F3EC19"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[PRIORITY] LOW","color":"129A47"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
# Create Labels [TYPE]
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[TYPE] BUG","color":"323543"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[TYPE] CODE CLIMATE","color":"323543"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[TYPE] DUPLICATE","color":"323543"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[TYPE] FEATURE REQUEST","color":"323543"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[TYPE] GOOD FIRST BUG","color":"323543"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[TYPE] INVALID","color":"323543"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[TYPE] QUESTION","color":"323543"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[TYPE] WP ENFORCER","color":"323543"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
# Create Labels [TEAM]
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[TEAM] DEV","color":"37B349"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[TEAM] PM","color":"37B349"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
# Create Labels [STATUS]
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[STATUS] HELP WANTED","color":"3981BF"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[STATUS] IN PROGRESS","color":"3981BF"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[STATUS] NEEDS DOCUMENTATION","color":"3981BF"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[STATUS] NEEDS REPORTER FEEDBACK","color":"3981BF"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[STATUS] NEEDS SECOND OPINION","color":"3981BF"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[STATUS] NEEDS TESTING","color":"3981BF"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[STATUS] NEEDS UNIT TESTS","color":"3981BF"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels"
curl --user "$USER:$PASS" --include --request POST --data '{"name":"[STATUS] WONT FIX","color":"3981BF"}' "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