Skip to content

Instantly share code, notes, and snippets.

@gridhead
Last active September 28, 2020 11:28
Show Gist options
  • Save gridhead/74767be2a03dc1663447c8f6656e915f to your computer and use it in GitHub Desktop.
Save gridhead/74767be2a03dc1663447c8f6656e915f to your computer and use it in GitHub Desktop.
Automating issue creation in GitHub using GitHub CLI
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