This script will read a markdown-formatted text file and generate milestones and issues in a Github project.
The script will go line by line, looking for lines that start with #
, -
or *
. Lines that
start with #
will create a new milestone. All bulleted items after a header will be created as
issues and assigned to the last milestone.
Milestones will be automatically assigned due-dates. Starting with the closest Friday at 1:30pm EST, every milestone will get a different due-date spaced one week apart.
To run the script, you need to first get a Github API key. Visit the personal access token page and generate a new token. Make sure it has repo
access.
Add this line, including your new key, to your ~/.bash_profile
or run it as a command before
you use the import script.
export GITHUB_API_TOKEN="mykey"
Make sure you have all necessary python libs installed
$ easy_install pip
$ pip install pygithub3
Now create a new text file and start adding your issues. When you're ready to upload them, run this command...
$ python import.py -h
usage: import.py [-h] ticket_file project
Load issues into github
positional arguments:
ticket_file file with tickets
project GitHub project (EX: account/project)
optional arguments:
-h, --help show this help message and exit
$ python import.py myproject.md account/project