Last active
March 7, 2016 22:52
-
-
Save db0company/0dab9b883f138704ed6e to your computer and use it in GitHub Desktop.
Script to create multiple opened/closed issues on GitHub easily
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
# 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