Created
August 23, 2017 14:51
-
-
Save jfear/34e0ebdb32439d20693f7efe5ae2ce7c to your computer and use it in GitHub Desktop.
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
| # Copied from: | |
| # https://raw.githubusercontent.com/thisisarray/GitHub-Issues-Process/master/set-github-labels.sh | |
| echo '' | |
| echo 'This script will remove the GitHub default labels and create the 80|20 process labels for your repo. A personal access token is required to access private repos.' | |
| echo '' | |
| echo -n 'GitHub Personal Access Token: ' | |
| read -s TOKEN | |
| echo '' | |
| echo -n 'GitHub Org/Repo (e.g. foo/bar): ' | |
| read REPO | |
| REPO_USER=$(echo "$REPO" | cut -f1 -d /) | |
| REPO_NAME=$(echo "$REPO" | cut -f2 -d /) | |
| # Delete default labels | |
| curl -u $TOKEN:x-oauth-basic --request DELETE https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/bug | |
| curl -u $TOKEN:x-oauth-basic --request DELETE https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/duplicate | |
| curl -u $TOKEN:x-oauth-basic --request DELETE https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/enhancement | |
| curl -u $TOKEN:x-oauth-basic --request DELETE https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/help%20wanted | |
| curl -u $TOKEN:x-oauth-basic --request DELETE https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/invalid | |
| curl -u $TOKEN:x-oauth-basic --request DELETE https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/question | |
| curl -u $TOKEN:x-oauth-basic --request DELETE https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels/wontfix | |
| #create state labels | |
| curl -u $TOKEN:x-oauth-basic --include --request POST --data '{"name":"Analysis","color":"fbca04"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
| curl -u $TOKEN:x-oauth-basic --include --request POST --data '{"name":"Ready","color":"fbca04"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
| curl -u $TOKEN:x-oauth-basic --include --request POST --data '{"name":"In Development","color":"fbca04"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
| curl -u $TOKEN:x-oauth-basic --include --request POST --data '{"name":"Feature Testing","color":"009800"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
| curl -u $TOKEN:x-oauth-basic --include --request POST --data '{"name":"Integration Testing","color":"009800"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
| curl -u $TOKEN:x-oauth-basic --include --request POST --data '{"name":"Blocked","color":"b60205"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
| curl -u $TOKEN:x-oauth-basic --include --request POST --data '{"name":"Test Failed","color":"b60205"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
| #create helper labels | |
| curl -u $TOKEN:x-oauth-basic --include --request POST --data '{"name":"Bug","color":"d93f0b"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
| curl -u $TOKEN:x-oauth-basic --include --request POST --data '{"name":"Trash","color":"000000"}' "https://api.github.com/repos/$REPO_USER/$REPO_NAME/labels" | |
| curl -u $TOKEN:x-oauth-basic --include --request POST --data '{"name":"Requirement","color":"c5def5"}' "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