Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Automatically label PRs from core team #32100

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/shared_core_label.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 23 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
@@ -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