Last active
April 6, 2022 17:56
-
-
Save mavvverick/9b6c5d06db253f8f16a85315069fb019 to your computer and use it in GitHub Desktop.
Add sane labels to GitHub Repo
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={{user}} or {{organisation}} | |
TOKEN={{token}} | |
REPO={{repo}} | |
#Delete default labels | |
curl --user "$USER:$TOKEN" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/bug" | |
curl --user "$USER:$TOKEN" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/duplicate" | |
curl --user "$USER:$TOKEN" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/enhancement" | |
curl --user "$USER:$TOKEN" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/invalid" | |
curl --user "$USER:$TOKEN" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/question" | |
curl --user "$USER:$TOKEN" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/wontfix" | |
curl --user "$USER:$TOKEN" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/documentation" | |
# Create labels | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"Status: Abandoned","color":"000000"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"Status: Accepted","color":"009800"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"Status: Available","color":"bfe5bf"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"Status: Blocked","color":"e11c21"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"Status: Completed","color":"006b75"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"Status: In Progress","color":"cccccc"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"Status: On Hold","color":"e11c21"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"Status: Pending","color":"fef2c0"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"Status: Review Needed","color":"fbca04"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"Status: Revision Needed","color":"e11c21"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"Type: Enhancement","color":"84b6eb"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"Type: Bug","color":"e11c21"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"Type: Maintenace","color":"fbca04"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"Type: Question","color":"cc317c"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"Priority: Critical","color":"e11c21"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"Priority: High","color":"eb641f"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"Priority: Low","color":"009800"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"Priority: Medium","color":"fbca04"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"duplicate","color":"aaaaaa"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"wishlist","color":"66Aa00"}' "https://api.github.com/repos/$USER/$REPO/labels" | |
curl --user "$USER:$TOKEN" --include --request POST --data '{"name":"declined","color":"83000C"}' "https://api.github.com/repos/$USER/$REPO/labels" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage: