Skip to content

Commit 07ca64f

Browse files
committed
[ci] Automatically label PRs from core team
Adds a new `MAINTAINERS` file which contains github usernames of core team members. This file serves as documentation for core team membership and is also used to automatically label PRs from core.
1 parent e5fdd99 commit 07ca64f

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: (Shared) Core Label
2+
3+
on:
4+
pull_request:
5+
6+
env:
7+
TZ: /usr/share/zoneinfo/America/Los_Angeles
8+
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
9+
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
10+
11+
jobs:
12+
core_label:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Check if actor is maintainer
17+
id: check_maintainer
18+
uses: actions/github-script@v7
19+
with:
20+
script: |
21+
const fs = require('fs');
22+
const data = await fs.readFileSync('./MAINTAINERS', { encoding: 'utf8' });
23+
const maintainers = new Set(data.split('\n'));
24+
if (maintainers.has('${{ github.actor }}')) {
25+
return true;
26+
}
27+
return false;
28+
- if: ${{ steps.check_maintainer.outputs.result == true }}
29+
uses: actions/github-script@v7
30+
with:
31+
script: |
32+
github.rest.issues.addLabels({
33+
owner: context.repo.owner,
34+
repo: context.repo.repo,
35+
issue_number: github.event.number,
36+
labels: ['React Core Team']
37+
});

MAINTAINERS

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
acdlite
2+
bvaughn
3+
eps1lon
4+
gaearon
5+
gnoff
6+
gsathya
7+
hoxyq
8+
jackpope
9+
jbonta
10+
josephsavona
11+
kassens
12+
lunaleaps
13+
mattcarrollcode
14+
mofeiZ
15+
noahlemen
16+
poteto
17+
rickhanlonii
18+
sebmarkbage
19+
sethwebster
20+
sophiebits
21+
TheSavior
22+
tyao1
23+
yuzhi

0 commit comments

Comments
 (0)