mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-10 19:57:09 +03:00
Find recent authors based on merged pull requests
This commit is contained in:
parent
8287a87de3
commit
85a5e46b92
|
@ -1,5 +1,6 @@
|
|||
import json
|
||||
from pathlib import Path
|
||||
from urllib.parse import urlencode
|
||||
|
||||
import requests
|
||||
from jinja2 import Template
|
||||
|
@ -50,10 +51,13 @@ class GitHub:
|
|||
return response.json()
|
||||
|
||||
def iter_recent_authors(self):
|
||||
commits = self.request("/repos/pydanny/cookiecutter-django/commits")
|
||||
for commit in commits:
|
||||
login = commit["author"]["login"]
|
||||
if login not in BOT_LOGINS:
|
||||
query_params = urlencode(
|
||||
{"state": "closed", "sort": "updated", "direction": "desc"}
|
||||
)
|
||||
pulls = self.request(f"/repos/pydanny/cookiecutter-django/pulls?{query_params}")
|
||||
for pull_request in pulls:
|
||||
login = pull_request["user"]["login"]
|
||||
if pull_request["merged_at"] and login not in BOT_LOGINS:
|
||||
yield login
|
||||
|
||||
def fetch_user_info(self, username):
|
||||
|
|
Loading…
Reference in New Issue
Block a user