Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/excaliburjs/Excalibur. 🎮 Your friendly TypeScript 2D game engine for the web 🗡️ excaliburjs.com
excalibur excaliburjs game-development game-engine game-framework gamedev games html5-canvas typescript
Something went wrong. Try again.
Python
at feat/ld-58
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
import requestsimport osfrom datetime import datetime
# Organization and GitHub Tokenorg = 'excaliburjs'token = os.getenv('GH_TOKEN')# repo: Provides necessary acess to repositories (including private ones) for fetching commits, issues, and discussions.# read:org: Essential for listing repositories in the organization.# read:discussion (if applicable): For accessing discussions.start_date = '2024-01-01T00:00:00Z' # Start of the last yearend_date = '2024-12-31T23:59:59Z' # End of the last yearheaders = {'Authorization': f'token {token}'}
# Get all repositories in the organizationrepo_url = f'https://api.github.com/orgs/{org}/repos'repos = requests.get(repo_url, headers=headers).json()
unique_committers = set()
# Iterate over all repositoriesfor repo in repos: repo_name = repo['name']
# Get commits for the repository within the specified date range commits_url = f'https://api.github.com/repos/{org}/{repo_name}/commits?since={start_date}&until={end_date}' # Handling pagination to get all commits while commits_url: commits_response = requests.get(commits_url, headers=headers) commit_json = commits_response.json()
# Add each committer to the set (ensuring uniqueness) for commit in commit_json: if 'author' in commit and commit['author'] is not None: unique_committers.add(commit['author']['login'])
# Check for pagination (if there is more data) if 'next' in commits_response.links: commits_url = commits_response.links['next']['url'] else: commits_url = None
# Print unique committersfor committer in unique_committers: print(committer)