Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
profvjreddi committed Oct 31, 2023
2 parents 775041a + 633eddc commit 5c09a05
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 104 deletions.
149 changes: 88 additions & 61 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,91 +7,100 @@
],
"contributors": [
{
"login": "mpstewart1",
"name": "Matthew Stewart",
"avatar_url": "https://avatars.githubusercontent.com/mpstewart1",
"profile": "https://github.com/mpstewart1",
"login": "Naeemkh",
"name": "naeemkh",
"avatar_url": "https://avatars.githubusercontent.com/Naeemkh",
"profile": "https://github.com/Naeemkh",
"contributions": [
"doc"
]
},
{
"login": "profvjreddi",
"name": "Vijay Janapa Reddi",
"avatar_url": "https://avatars.githubusercontent.com/profvjreddi",
"profile": "https://github.com/profvjreddi",
"login": "sophiacho1",
"name": "sophiacho1",
"avatar_url": "https://avatars.githubusercontent.com/sophiacho1",
"profile": "https://github.com/sophiacho1",
"contributions": [
"doc"
]
},
{
"login": "ishapira1",
"name": "ishapira",
"avatar_url": "https://avatars.githubusercontent.com/ishapira1",
"profile": "https://github.com/ishapira1",
"login": "ShvetankPrakash",
"name": "Shvetank Prakash",
"avatar_url": "https://avatars.githubusercontent.com/ShvetankPrakash",
"profile": "https://github.com/ShvetankPrakash",
"contributions": [
"doc"
]
},
{
"login": "Mjrovai",
"name": "Marcelo Rovai",
"avatar_url": "https://avatars.githubusercontent.com/Mjrovai",
"profile": "https://github.com/Mjrovai",
"login": "jaysonzlin",
"name": "Jayson Lin",
"avatar_url": "https://avatars.githubusercontent.com/jaysonzlin",
"profile": "https://github.com/jaysonzlin",
"contributions": [
"doc"
]
},
{
"login": "oishib",
"name": "oishib",
"avatar_url": "https://avatars.githubusercontent.com/oishib",
"profile": "https://github.com/oishib",
"login": "BaeHenryS",
"name": "Henry Bae",
"avatar_url": "https://avatars.githubusercontent.com/BaeHenryS",
"profile": "https://github.com/BaeHenryS",
"contributions": [
"doc"
]
},
{
"login": "uchendui",
"name": "Ikechukwu Uchendu",
"avatar_url": "https://avatars.githubusercontent.com/uchendui",
"profile": "https://github.com/uchendui",
"login": "ishapira1",
"name": "ishapira",
"avatar_url": "https://avatars.githubusercontent.com/ishapira1",
"profile": "https://github.com/ishapira1",
"contributions": [
"doc"
]
},
{
"login": "Naeemkh",
"name": "naeemkh",
"avatar_url": "https://avatars.githubusercontent.com/Naeemkh",
"profile": "https://github.com/Naeemkh",
"login": "sjohri20",
"name": "sjohri20",
"avatar_url": "https://avatars.githubusercontent.com/sjohri20",
"profile": "https://github.com/sjohri20",
"contributions": [
"doc"
]
},
{
"login": "mmaz",
"name": "Mark Mazumder",
"avatar_url": "https://avatars.githubusercontent.com/mmaz",
"profile": "https://github.com/mmaz",
"login": "marcozennaro",
"name": "Marco Zennaro",
"avatar_url": "https://avatars.githubusercontent.com/marcozennaro",
"profile": "https://github.com/marcozennaro",
"contributions": [
"doc"
]
},
{
"login": "sophiacho1",
"name": "sophiacho1",
"avatar_url": "https://avatars.githubusercontent.com/sophiacho1",
"profile": "https://github.com/sophiacho1",
"login": "oishib",
"name": "oishib",
"avatar_url": "https://avatars.githubusercontent.com/oishib",
"profile": "https://github.com/oishib",
"contributions": [
"doc"
]
},
{
"login": "ShvetankPrakash",
"name": "Shvetank Prakash",
"avatar_url": "https://avatars.githubusercontent.com/ShvetankPrakash",
"profile": "https://github.com/ShvetankPrakash",
"login": "mpstewart1",
"name": "Matthew Stewart",
"avatar_url": "https://avatars.githubusercontent.com/mpstewart1",
"profile": "https://github.com/mpstewart1",
"contributions": [
"doc"
]
},
{
"login": "jessicaquaye",
"name": "Jessica Quaye",
"avatar_url": "https://avatars.githubusercontent.com/jessicaquaye",
"profile": "https://github.com/jessicaquaye",
"contributions": [
"doc"
]
Expand All @@ -106,53 +115,71 @@
]
},
{
"login": "jessicaquaye",
"name": "Jessica Quaye",
"avatar_url": "https://avatars.githubusercontent.com/jessicaquaye",
"profile": "https://github.com/jessicaquaye",
"login": "uchendui",
"name": "Ikechukwu Uchendu",
"avatar_url": "https://avatars.githubusercontent.com/uchendui",
"profile": "https://github.com/uchendui",
"contributions": [
"doc"
]
},
{
"login": "DivyaAmirtharaj",
"name": "Divya",
"avatar_url": "https://avatars.githubusercontent.com/DivyaAmirtharaj",
"profile": "https://github.com/DivyaAmirtharaj",
"login": "aptl26",
"name": "aptl26",
"avatar_url": "https://avatars.githubusercontent.com/aptl26",
"profile": "https://github.com/aptl26",
"contributions": [
"doc"
]
},
{
"login": "BaeHenryS",
"name": "Henry Bae",
"avatar_url": "https://avatars.githubusercontent.com/BaeHenryS",
"profile": "https://github.com/BaeHenryS",
"login": "mmaz",
"name": "Mark Mazumder",
"avatar_url": "https://avatars.githubusercontent.com/mmaz",
"profile": "https://github.com/mmaz",
"contributions": [
"doc"
]
},
{
"login": "sjohri20",
"name": "sjohri20",
"avatar_url": "https://avatars.githubusercontent.com/sjohri20",
"profile": "https://github.com/sjohri20",
"login": "18jeffreyma",
"name": "Jeffrey Ma",
"avatar_url": "https://avatars.githubusercontent.com/18jeffreyma",
"profile": "https://github.com/18jeffreyma",
"contributions": [
"doc"
]
},
{
"login": "marcozennaro",
"name": "Marco Zennaro",
"avatar_url": "https://avatars.githubusercontent.com/marcozennaro",
"profile": "https://github.com/marcozennaro",
"login": "Mjrovai",
"name": "Marcelo Rovai",
"avatar_url": "https://avatars.githubusercontent.com/Mjrovai",
"profile": "https://github.com/Mjrovai",
"contributions": [
"doc"
]
},
{
"login": "DivyaAmirtharaj",
"name": "Divya",
"avatar_url": "https://avatars.githubusercontent.com/DivyaAmirtharaj",
"profile": "https://github.com/DivyaAmirtharaj",
"contributions": [
"doc"
]
},
{
"login": "profvjreddi",
"name": "Vijay Janapa Reddi",
"avatar_url": "https://avatars.githubusercontent.com/profvjreddi",
"profile": "https://github.com/profvjreddi",
"contributions": [
"doc"
]
}
],
"repoType": "github",
"contributorsPerLine": 7,
"contributorsPerLine": 5,
"repoHost": "https=//github.com",
"commitConvention": "angular",
"skipCi": true,
Expand Down
26 changes: 15 additions & 11 deletions .github/workflows/contributors/update_contributors.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import collections
import json
import os

Expand Down Expand Up @@ -31,15 +32,17 @@ def main(_):
last_page = res.links.get('last', {}).get('url', None)

user_to_name_dict = dict()
users_from_api = []
name_to_user_dict = dict()
users_from_api = set()
user_full_names_from_api = set()

for node in data:
commit_info = node.get('commit', None)
commit_author_info = commit_info.get('author', None)
commit_commiter_info = commit_info.get('committer', None)
author_info = node.get('author', None)
committer_info = node.get('committer', None)
committer_login_info = committer_info.get('login', None)
committer_login_info = committer_info.get('login', None) if committer_info else None
user_full_name = None
username = None

Expand All @@ -53,13 +56,13 @@ def main(_):
elif committer_login_info:
username = committer_login_info['login']

assert user_full_name is not None, 'User full name should not be None'
assert username is not None, 'Username should not be None'
if user_full_name:
name_to_user_dict[user_full_name] = username if username else None
user_full_names_from_api.add(user_full_name)
if username:
user_to_name_dict[username] = user_full_name if user_full_name else None
users_from_api.add(username)

user_to_name_dict[username] = user_full_name
users_from_api.append(username)

users_from_api = set(users_from_api)
print('Users pulled from API: ', users_from_api)

with open(CONTRIBUTORS_FILE, 'r') as contrib_file:
Expand All @@ -78,7 +81,7 @@ def main(_):
users_from_api), 'All contributors in the .all-contributorsrc file should be pulled using the API'

new_contributor_logins = users_from_api - existing_contributor_logins_set
print('New contributors: ', new_contributor_logins)
print('New contributors: ', new_contributor_logins - EXCLUDED_USERS)

result = users_from_api - EXCLUDED_USERS

Expand All @@ -87,14 +90,15 @@ def main(_):
projectOwner=OWNER,
files=["contributors.qmd", "README.md"],
contributors=[dict(login=user,
name=user_to_name_dict[user],
name=user_to_name_dict[user] or user,
# If the user has no full name listed, use their username
avatar_url=f'https://avatars.githubusercontent.com/{user}',
profile=f'https://github.com/{user}',
contributions=['doc'], ) for
user in result],

repoType='github',
contributorsPerLine=7,
contributorsPerLine=5,
repoHost="https=//github.com",
commitConvention='angular',
skipCi=True,
Expand Down
Loading

0 comments on commit 5c09a05

Please sign in to comment.