mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[ci] Make maintainer check workflow usable from other repositories
For use in reactjs/react.dev
This commit is contained in:
@@ -29,7 +29,17 @@ jobs:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
const actor = '${{ inputs.actor }}';
|
||||
const data = await fs.readFileSync('./MAINTAINERS', { encoding: 'utf8' });
|
||||
const data = octokit.rest.repos.getContent({
|
||||
owner: 'facebook',
|
||||
repo: 'react',
|
||||
path: 'MAINTAINERS.md',
|
||||
ref: 'main',
|
||||
headers: {
|
||||
Accept: 'application/vnd.github+json'
|
||||
}
|
||||
});
|
||||
console.log(data);
|
||||
// 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`);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: (Shared) Label Core Team PRs
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
TZ: /usr/share/zoneinfo/America/Los_Angeles
|
||||
@@ -10,7 +10,7 @@ env:
|
||||
|
||||
jobs:
|
||||
check_maintainer:
|
||||
uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main
|
||||
uses: facebook/react/.github/workflows/shared_check_maintainer.yml@pr32215
|
||||
with:
|
||||
actor: ${{ github.event.pull_request.user.login }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user