Skip to content

Instantly share code, notes, and snippets.

@leplatrem
Last active September 17, 2021 14:01
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 leplatrem/52c5057898c8a029c338b8b9b7b7529e to your computer and use it in GitHub Desktop.
Save leplatrem/52c5057898c8a029c338b8b9b7b7529e to your computer and use it in GitHub Desktop.
import datetime
import os
from github import Github # pip install --user PyGithub
september_first = datetime.datetime(2021, 9, 1)
def main():
g = Github(os.getenv("TOKEN"))
org = g.get_organization(os.getenv("ORG", "taskcluster"))
repos = org.get_repos()
for repo in repos:
if repo.archived:
continue
root_content = repo.get_contents("/")
travis_file = [file.name == ".travis.yml" for file in root_content]
if not any(travis_file):
continue
print(repo.html_url)
pulls = repo.get_pulls(state="all", sort="created", direction="desc")
for pull in pulls:
if pull.created_at < september_first:
break
print(" ", pull)
if __name__ == "__main__":
# TOKEN=ac6d1f0...dfd python main.py
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment