Skip to content

Instantly share code, notes, and snippets.

@mattcannon
Last active February 8, 2019 11:56
Show Gist options
  • Save mattcannon/15d4609e4a8b3ef90fcc8f067d2a4a60 to your computer and use it in GitHub Desktop.
Save mattcannon/15d4609e4a8b3ef90fcc8f067d2a4a60 to your computer and use it in GitHub Desktop.
Script to add default labels to new repos.
USER=myuser
PASS=mypassword
REPO=myrepo
OTP=123456
curl -u $USER:$PASS --include --request POST --data '{"name":"s:1.hour","color":"0000ff"}' "https://api.github.com/repos/MethodClass/$REPO/labels"
curl -u $USER:$PASS --include --request POST --data '{"name":"s:2.half-day","color":"008800"}' "https://api.github.com/repos/MethodClass/$REPO/labels"
curl -u $USER:$PASS --include --request POST --data '{"name":"s:3.day","color":"eeee00"}' "https://api.github.com/repos/MethodClass/$REPO/labels"
curl -u $USER:$PASS --include --request POST --data '{"name":"s:4.half-week","color":"ffaa00"}' "https://api.github.com/repos/MethodClass/$REPO/labels"
curl -u $USER:$PASS --include --request POST --data '{"name":"s:5.week","color":"ff7700"}' "https://api.github.com/repos/MethodClass/$REPO/labels"
curl -u $USER:$PASS --include --request POST --data '{"name":"s:6.epic","color":"dd0000"}' "https://api.github.com/repos/MethodClass/$REPO/labels"
# curl -u $USER:$PASS -H "X-GitHub-OTP:$OTP" --include --request POST --data '{"name":"s:1.hour","color":"0000ff"}' "https://api.github.com/repos/MethodClass/$REPO/labels"
# curl -u $USER:$PASS -H "X-GitHub-OTP:$OTP" --include --request POST --data '{"name":"s:2.half-day","color":"008800"}' "https://api.github.com/repos/MethodClass/$REPO/labels"
# curl -u $USER:$PASS -H "X-GitHub-OTP:$OTP" --include --request POST --data '{"name":"s:3.day","color":"eeee00"}' "https://api.github.com/repos/MethodClass/$REPO/labels"
# curl -u $USER:$PASS -H "X-GitHub-OTP:$OTP" --include --request POST --data '{"name":"s:4.week","color":"ff7700"}' "https://api.github.com/repos/MethodClass/$REPO/labels"
# curl -u $USER:$PASS -H "X-GitHub-OTP:$OTP" --include --request POST --data '{"name":"s:5.epic","color":"dd0000"}' "https://api.github.com/repos/MethodClass/$REPO/labels"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment