Created
December 17, 2018 20:25
-
-
Save sbenthall/14c4d14c00876440ba6d0ae62efa432f to your computer and use it in GitHub Desktop.
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
import git | |
import os | |
import shutil | |
tmp_dir = "tmp_repo_dir" | |
def get_tags(org,repo): | |
shutil.rmtree(tmp_dir) | |
print("Getting tags for %s/%s" % (org, repo)) | |
git_url= "[email protected]:%s/%s.git" % (org,repo) | |
if not os.path.exists(tmp_dir): | |
os.mkdir(tmp_dir) | |
repo = git.Repo.clone_from(git_url,tmp_dir) | |
print("%d tags" % (len(repo.tags))) | |
tags = [(tag.name, | |
tag.commit.author.name, | |
tag.commit.author.email, | |
tag.commit.committed_datetime) | |
for tag | |
in repo.tags] | |
shutil.rmtree(tmp_dir) | |
def main(org,repo): | |
get_tags(org,repo) | |
if __name__ == '__main__': | |
main(org="nodejs", repo="node") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment