Skip to content

Instantly share code, notes, and snippets.

@e18r
Created July 9, 2019 21: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 e18r/a573e794b22fbc6b3f784710df6f8edf to your computer and use it in GitHub Desktop.
Save e18r/a573e794b22fbc6b3f784710df6f8edf to your computer and use it in GitHub Desktop.
#! /usr/bin/env python
# Only use with a test Github account
# To install: pip install PyGithub
from github import Github
from sys import argv
user = 'e18rtest' # GitHub username
pw = 'dVmaNfBsPCSdaVjI' # password
repo_index = 0 # GitHub repository number sorted by creation date
def login():
print('logging in... ', end='')
g = Github(user, pw)
repo = g.get_user().get_repos()[repo_index]
print('y')
return repo
def create(start, end):
repo = login()
for i in range(start, end + 1):
print('{} / {}... '.format(i, end), end='')
try:
repo.create_issue('bulk issue # {}'.format(i))
print('y')
except:
print('n')
repo = login()
print('retrying {}... '.format(i), end='')
repo.create_issue('bulk issue # {}'.format(i))
print('y')
# start issue number, end issue number (inclusive)
create(int(argv[1]), int(argv[2]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment