mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-07-14 10:02:27 +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
|
import json
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from urllib.parse import urlencode
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from jinja2 import Template
|
from jinja2 import Template
|
||||||
|
@ -50,10 +51,13 @@ class GitHub:
|
||||||
return response.json()
|
return response.json()
|
||||||
|
|
||||||
def iter_recent_authors(self):
|
def iter_recent_authors(self):
|
||||||
commits = self.request("/repos/pydanny/cookiecutter-django/commits")
|
query_params = urlencode(
|
||||||
for commit in commits:
|
{"state": "closed", "sort": "updated", "direction": "desc"}
|
||||||
login = commit["author"]["login"]
|
)
|
||||||
if login not in BOT_LOGINS:
|
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
|
yield login
|
||||||
|
|
||||||
def fetch_user_info(self, username):
|
def fetch_user_info(self, username):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user