Last active
January 1, 2024 19:11
-
-
Save FrostyX/3c9b673ff7c32295604aef58bb2c2ce7 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/python3 | |
import sys | |
import subprocess | |
labels = { | |
"effort/low": "Can be done in few hours", | |
"effort/medium": "Can be done in 1-2 days", | |
"effort/high": "Requires 3 or more days", | |
"gain/low": "Affect only one person, corner case, has easy workaround", | |
"gain/medium": "Affects multiple users", | |
"gain/high": "Significantly moves the project forward", | |
} | |
if len(sys.argv) < 2: | |
print("Error: Specify a github repository") | |
sys.exit(1) | |
for name, description in labels.items(): | |
cmd = [ | |
"gh", "label", "create", name, | |
"--description", description, | |
"--color", "#FFFFFF", | |
"--repo", sys.argv[1], | |
"--force" # Update if already exists | |
] | |
proc = subprocess.run(cmd) | |
if proc.returncode != 0: | |
print("Failed to create {0}".format(name)) | |
sys.exit(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment