gitmon/main.py
2023-11-10 22:33:08 -05:00

28 lines
506 B
Python

"""GitMon"""
from gitmon.api import GitHubApi
from gitmon.logger import setup_logger
from config import token
def print_event(event):
event_type = event.get('type')
repo = event.get('repo')
actor = event.get('actor')
print(f'{event_type}:\t{repo["name"]}, {actor["login"]}')
def main():
"""Main entry point."""
setup_logger()
api = GitHubApi(token)
events = api.get_events()
for event in events:
print_event(event)
if __name__ == '__main__':
main()