Created
March 7, 2016 22:58
-
-
Save db0company/af073004ade6a70da10b to your computer and use it in GitHub Desktop.
Script to duplicate milestones from a repo to another one 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' | |
from_owner = username # Can be an organization | |
from_repo = 'yourrepo' | |
to_owners = [username, username] # Can be organizations | |
to_repos = ['yourotherrepo', 'andanotherrepo'] | |
g = Github(yourusername, yourpassword) | |
status, milestones = g.repos[from_owner][from_repo].milestones.get() | |
for (to_owner, to_repo) in zip(to_owners, to_repos): | |
for m in milestones: | |
g.repos[to_owner][to_repo].milestones.post(body={'title': m['title'], 'description': m['description'], 'due_on': m['due_on'] }) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment