mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
[ci] Automatically label PRs from core team (#32100)
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. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32100). * #32101 * __->__ #32100
This commit is contained in:
parent
35dcf02b04
commit
af4987e19f
41
.github/workflows/shared_core_label.yml
vendored
Normal file
41
.github/workflows/shared_core_label.yml
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
name: (Shared) Core Label
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
|
||||
env:
|
||||
TZ: /usr/share/zoneinfo/America/Los_Angeles
|
||||
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
|
||||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
|
||||
|
||||
jobs:
|
||||
core_label:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Check if actor is maintainer
|
||||
id: check_maintainer
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
const actor = '${{ github.actor }}';
|
||||
const data = await fs.readFileSync('./MAINTAINERS', { encoding: 'utf8' });
|
||||
const maintainers = new Set(data.split('\n'));
|
||||
if (maintainers.has(actor)) {
|
||||
console.log(`🟢 ${actor} is a maintainer`);
|
||||
return true;
|
||||
}
|
||||
console.log(`🔴 ${actor} is NOT a maintainer`);
|
||||
return null;
|
||||
- name: Label PR as React Core Team
|
||||
if: ${{ steps.check_maintainer.outputs.result }}
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: ${{ github.event.number }},
|
||||
labels: ['React Core Team']
|
||||
});
|
||||
23
MAINTAINERS
Normal file
23
MAINTAINERS
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
acdlite
|
||||
bvaughn
|
||||
eps1lon
|
||||
gaearon
|
||||
gnoff
|
||||
gsathya
|
||||
hoxyq
|
||||
jackpope
|
||||
jbonta
|
||||
josephsavona
|
||||
kassens
|
||||
lunaleaps
|
||||
mattcarrollcode
|
||||
mofeiZ
|
||||
noahlemen
|
||||
poteto
|
||||
rickhanlonii
|
||||
sebmarkbage
|
||||
sethwebster
|
||||
sophiebits
|
||||
TheSavior
|
||||
tyao1
|
||||
yuzhi
|
||||
Loading…
Reference in New Issue
Block a user