Last active
September 28, 2020 11:28
-
-
Save gridhead/74767be2a03dc1663447c8f6656e915f to your computer and use it in GitHub Desktop.
Automating issue creation in GitHub using GitHub CLI
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
import json, os | |
def appender(lict:list): | |
textdata = "" | |
for indx in lict: | |
textdata += indx + "," | |
return textdata[:-1] | |
def create_issues_from_json(): | |
lict = json.loads(open("issulist.json", "r").read()) | |
for indx in lict: | |
if os.system("gh issue create -t '" + indx["issuname"] + "' -b 'To find more about the issue, visit " + indx["issulink"] + "' -l '" + appender(indx["issutags"]) + "'") == 0: | |
print(str(indx["issuqant"]) + " was created!") | |
else: | |
print(str(indx["issuqant"]) + " could not be created!") | |
if __name__ == "__main__": | |
create_issues_from_json() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment