Skip to content

Instantly share code, notes, and snippets.

@db0company
Last active March 7, 2016 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save db0company/0dab9b883f138704ed6e to your computer and use it in GitHub Desktop.
Save db0company/0dab9b883f138704ed6e to your computer and use it in GitHub Desktop.
Script to create multiple opened/closed issues on GitHub easily
# Get agithub.py from https://github.com/jpaugh/agithub
from agithub import Github
username = 'yourusername'
password = 'yourpassword'
owner = username # Can be an organization
repo = 'YourRepo'
assignee = username
labels = ['task']
closed_issues = [
'Remove link on the homepage',
'Fix username not loading',
]
opened_issues = [
'Add an animated gif of a panda when people log in',
'Fix ingredient not added after clicking "Add"',
]
#####
g = Github(username, password)
print 'Create closed issues'
for issue in closed_issues:
print issue
status, issue = g.repos[owner][repo].issues.post(body={'title': issue, 'assignee': assignee, 'labels': labels})
g.repos[owner][repo].issues[issue['number']].patch(body={'state': 'closed'})
print 'Opened issues'
for issue in opened_issues:
print issue
status, issue = g.repos[owner][repo].issues.post(body={'title': issue, 'assignee': assignee, 'labels': labels})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment