Last active
September 17, 2021 14:01
-
-
Save leplatrem/52c5057898c8a029c338b8b9b7b7529e 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 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