8000 👷 Add new GitHub Action to update contributors, translators, and tran… · fastapi/fastapi@b59885c · GitHub
[go: up one dir, main page]

Skip to content

Commit b59885c

Browse files
authored
👷 Add new GitHub Action to update contributors, translators, and translation reviewers (#13136)
1 parent dd649ff commit b59885c

File tree

9 files changed

+413
-21
lines changed

9 files changed

+413
-21
lines changed

.github/workflows/contributors.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: FastAPI People Contributors
2+
3+
on:
4+
schedule:
5+
- cron: "0 3 1 * *"
6+
workflow_dispatch:
7+
inputs:
8+
debug_enabled:
9+
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
10+
required: false
11+
default: "false"
12+
13+
env:
14+
UV_SYSTEM_PYTHON: 1
15+
16+
jobs:
17+
job:
18+
if: github.repository_owner == 'fastapi'
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: write
22+
steps:
23+
- name: Dump GitHub context
24+
env:
25+
GITHUB_CONTEXT: ${{ toJson(github) }}
26+
run: echo "$GITHUB_CONTEXT"
27+
- uses: actions/checkout@v4
28+
- name: Set up Python
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: "3.11"
32+
- name: Setup uv
33+
uses: astral-sh/setup-uv@v5
34+
with:
35+
version: "0.4.15"
36+
enable-cache: true
37+
cache-dependency-glob: |
38+
requirements**.txt
39+
pyproject.toml
40+
- name: Install Dependencies
41+
run: uv pip install -r requirements-github-actions.txt
42+
# Allow debugging with tmate
43+
- name: Setup tmate session
44+
uses: mxschmitt/action-tmate@v3
45+
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
46+
with:
47+
limit-access-to-actor: true
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.FASTAPI_PR_TOKEN }}
50+
- name: FastAPI People Contributors
51+
run: python ./scripts/contributors.py
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.FASTAPI_PR_TOKEN }}

docs/en/data/contributors.yml

Whitespace-only changes.

docs/en/data/skip_users.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- tiangolo
2+
- codecov
3+
- github-actions
4+
- pre-commit-ci
5+
- dependabot

docs/en/data/translation_reviewers.yml

Whitespace-only changes.

docs/en/data/translators.yml

Whitespace-only changes.

docs/en/docs/fastapi-people.md

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@ Hey! 👋
1313

1414
This is me:
1515

16-
{% if people %}
1716
<div class="user-list user-list-center">
1817
{% for user in people.maintainers %}
1918

20-
<div class="user"><a href="{{ user.url }}" target="_blank"><div class="avatar-wrapper"><img src="{{ user.avatarUrl }}"/></div><div class="title">@{{ user.login }}</div></a> <div class="count">Answers: {{ user.answers }}</div><div class="count">Pull Requests: {{ user.prs }}</div></div>
19+
<div class="user"><a href="{{ contributors.tiangolo.url }}" target="_blank"><div class="avatar-wrapper"><img src="{{ contributors.tiangolo.avatarUrl }}"/></div><div class="title">@{{ contributors.tiangolo.login }}</div></a> <div class="count">Answers: {{ user.answers }}</div><div class="count">Pull Requests: {{ contributors.tiangolo.count }}</div></div>
2120
{% endfor %}
2221

2322
</div>
24-
{% endif %}
2523

2624
I'm the creator of **FastAPI**. You can read more about that in [Help FastAPI - Get Help - Connect with the author](help-fastapi.md#connect-with-the-author){.internal-link target=_blank}.
2725

@@ -84,109 +82,125 @@ You can see the **FastAPI Experts** for:
8482

8583
These are the users that have been [helping others the most with questions in GitHub] 6854 (help-fastapi.md#help-others-with-questions-in-github){.internal-link target=_blank} during the last month. 🤓
8684

87-
{% if people %}
8885
<div class="user-list user-list-center">
8986
{% for user in people.last_month_experts[:10] %}
9087

9188
<div class="user"><a href="{{ user.url }}" target="_blank"><div class="avatar-wrapper"><img src="{{ user.avatarUrl }}"/></div><div class="title">@{{ user.login }}</div></a> <div class="count">Questions replied: {{ user.count }}</div></div>
9289
{% endfor %}
9390

9491
</div>
95-
{% endif %}
9692

9793
### FastAPI Experts - 3 Months
9894

9995
These are the users that have been [helping others the most with questions in GitHub](help-fastapi.md#help-others-with-questions-in-github){.internal-link target=_blank} during the last 3 months. 😎
10096

101-
{% if people %}
10297
<div class="user-list user-list-center">
10398
{% for user in people.three_months_experts[:10] %}
10499

105100
<div class="user"><a href="{{ user.url }}" target="_blank"><div class="avatar-wrapper"><img src="{{ user.avatarUrl }}"/></div><div class="title">@{{ user.login }}</div></a> <div class="count">Questions replied: {{ user.count }}</div></div>
106101
{% endfor %}
107102

108103
</div>
109-
{% endif %}
110104

111105
### FastAPI Experts - 6 Months
112106

113107
These are the users that have been [helping others the most with questions in GitHub](help-fastapi.md#help-others-with-questions-in-github){.internal-link target=_blank} during the last 6 months. 🧐
114108

115-
{% if people %}
116109
<div class="user-list user-list-center">
117110
{% for user in people.six_months_experts[:10] %}
118111

119112
<div class="user"><a href="{{ user.url }}" target="_blank"><div class="avatar-wrapper"><img src="{{ user.avatarUrl }}"/></div><div class="title">@{{ user.login }}</div></a> <div class="count">Questions replied: {{ user.count }}</div></div>
120113
{% endfor %}
121114

122115
</div>
123-
{% endif %}
124116

125117
### FastAPI Experts - 1 Year
126118

127119
These are the users that have been [helping others the most with questions in GitHub](help-fastapi.md#help-others-with-questions-in-github){.internal-link target=_blank} during the last year. 🧑‍🔬
128120

129-
{% if people %}
130121
<div class="user-list user-list-center">
131122
{% for user in people.one_year_experts[:20] %}
132123

133124
<div class="user"><a href="{{ user.url }}" target="_blank"><div class="avatar-wrapper"><img src="{{ user.avatarUrl }}"/></div><div class="title">@{{ user.login }}</div></a> <div class="count">Questions replied: {{ user.count }}</div></div>
134125
{% endfor %}
135126

136127
</div>
137-
{% endif %}
138128

139129
### FastAPI Experts - All Time
140130

141131
Here are the all time **FastAPI Experts**. 🤓🤯
142132

143133
These are the users that have [helped others the most with questions in GitHub](help-fastapi.md#help-others-with-questions-in-github){.internal-link target=_blank} through *all time*. 🧙
144134

145-
{% if people %}
146135
<div class="user-list user-list-center">
147136
{% for user in people.experts[:50] %}
148137

149138
<div class="user"><a href="{{ user.url }}" target="_blank"><div class="avatar-wrapper"><img src="{{ user.avatarUrl }}"/></div><div class="title">@{{ user.login }}</div></a> <div class="count">Questions replied: {{ user.count }}</div></div>
150139
{% endfor %}
151140

152141
</div>
153-
{% endif %}
154142

155143
## Top Contributors
156144

157145
Here are the **Top Contributors**. 👷
158146

159147
These users have [created the most Pull Requests](help-fastapi.md#create-a-pull-request){.internal-link target=_blank} that have been *merged*.
160148

161-
They have contributed source code, documentation, translations, etc. 📦
149+
They have contributed source code, documentation, etc. 📦
162150

163-
{% if people %}
164151
<div class="user-list user-list-center">
165-
{% for user in people.top_contributors[:50] %}
152+
{% for user in (contributors.values() | list)[:50] %}
153+
154+
{% if user.login not in skip_users %}
166155

167156
<div class="user"><a href="{{ user.url }}" target="_blank"><div class="avatar-wrapper"><img src="{{ user.avatarUrl }}"/></div><div class="title">@{{ user.login }}</div></a> <div class="count">Pull Requests: {{ user.count }}</div></div>
157+
158+
{% endif %}
159+
168160
{% endfor %}
169161

170162
</div>
163+
164+
There are hundreds of other contributors, you can see them all in the <a href="https://github.com/fastapi/fastapi/graphs/contributors" class="external-link" target="_blank">FastAPI GitHub Contributors page</a>. 👷
165+
166+
## Top Translators
167+
168+
These are the **Top Translators**. 🌐
169+
170+
These users have created the most Pull Requests with [translations to other languages](contributing.md#translations){.internal-link target=_blank} that have been *merged*.
171+
172+
<div class="user-list user-list-center">
173+
174+
{% for user in (translators.values() | list)[:50] %}
175+
176+
{% if user.login not in skip_users %}
177+
178+
<div class="user"><a href="{{ user.url }}" target="_blank"><div class="avatar-wrapper"><img src="{{ user.avatarUrl }}"/></div><div class="title">@{{ user.login }}</div></a> <div class="count">Translations: {{ user.count }}</div></div>
179+
171180
{% endif %}
172181

173-
There are many other contributors (more than a hundred), you can see them all in the <a href="https://github.com/fastapi/fastapi/graphs/contributors" class="external-link" target="_blank">FastAPI GitHub Contributors page</a>. 👷
182+
{% endfor %}
183+
184+
</div>
174185

175186
## Top Translation Reviewers
176187

177188
These users are the **Top Translation Reviewers**. 🕵️
178189

179190
I only speak a few languages (and not very well 😅). So, the reviewers are the ones that have the [**power to approve translations**](contributing.md#translations){.internal-link target=_blank} of the documentation. Without them, there wouldn't be documentation in several other languages.
180191

181-
{% if people %}
182192
<div class="user-list user-list-center">
183-
{% for user in people.top_translations_reviewers[:50] %}
193+
{% for user in (translation_reviewers.values() | list)[:50] %}
194+
195+
{% if user.login not in skip_users %}
184196

185197
<div class="user"><a href="{{ user.url }}" target="_blank"><div class="avatar-wrapper"><img src="{{ user.avatarUrl }}"/></div><div class="title">@{{ user.login }}</div></a> <div class="count">Reviews: {{ user.count }}</div></div>
198+
199+
{% endif %}
200+
186201
{% endfor %}
187202

188203
</div>
189-
{% endif %}
190204

191205
## Sponsors
192206

@@ -251,7 +265,7 @@ The main intention of this page is to highlight the effort of the community to h
251265

252266
Especially including efforts that are normally less visible, and in many cases more arduous, like helping others with questions and reviewing Pull Requests with translations.
253267

254-
The data is calculated each month, you can read the <a href="https://github.com/fastapi/fastapi/blob/master/.github/actions/people/app/main.py" class="external-link" target="_blank">source code here</a>.
268+
The data is calculated each month, you can read the <a href="https://github.com/fastapi/fastapi/blob/master/scripts/" class="external-link" target="_blank">source code here</a>.
255269

256270
Here I'm also highlighting contributions from sponsors.
257271

docs/en/mkdocs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ plugins:
6565
- external_links: ../en/data/external_links.yml
6666
- github_sponsors: ../en/data/github_sponsors.yml
6767
- people: ../en/data/people.yml
68+
- contributors: ../en/data/contributors.yml
69+
- translators: ../en/data/translators.yml
70+
- translation_reviewers: ../en/data/translation_reviewers.yml
71+
- skip_users: ../en/data/skip_users.yml
6872
- members: ../en/data/members.yml
6973
- sponsors_badge: ../en/data/sponsors_badge.yml
7074
- sponsors: ../en/data/sponsors.yml

requirements-github-actions.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ PyGithub>=2.3.0,<3.0.0
22
pydantic>=2.5.3,<3.0.0
33
pydantic-settings>=2.1.0,<3.0.0
44
httpx>=0.27.0,<0.28.0
5+
pyyaml >=5.3.1,<7.0.0
56
smokeshow

0 commit comments

Comments
 (0)
0