-
Notifications
You must be signed in to change notification settings - Fork 47.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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.
- Loading branch information
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: (Shared) Core Label | ||
|
||
on: | ||
pull_request: | ||
|
||
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: | ||
notify: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check if actor is maintainer | ||
id: check_maintainer | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const fs = require('fs/promises'); | ||
async function getMaintainers() { | ||
const data = await fs.readFile('./MAINTAINERS', { encoding: 'utf8' }); | ||
return new Set(data.split('\n')); | ||
} | ||
async function main() { | ||
const maintainers = await getMaintainers(); | ||
if (maintainers.has(github.event.actor)) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
- if: ${{ steps.check_maintainer.outputs.result == true }} | ||
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'] | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |