Skip to content

Commit 3f3d02d

Browse files
committed
[ci] Make maintainer check workflow usable from other repositories
For use in reactjs/react.dev
1 parent b65afdd commit 3f3d02d

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.github/workflows/shared_check_maintainer.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,17 @@ jobs:
2929
script: |
3030
const fs = require('fs');
3131
const actor = '${{ inputs.actor }}';
32-
const data = await fs.readFileSync('./MAINTAINERS', { encoding: 'utf8' });
32+
const data = octokit.rest.repos.getContent({
33+
owner: 'facebook',
34+
repo: 'react',
35+
path: 'MAINTAINERS.md',
36+
ref: 'main',
37+
headers: {
38+
Accept: 'application/vnd.github+json '
39+
}
40+
});
41+
console.log(data);
42+
# const data = await fs.readFileSync('./MAINTAINERS', { encoding: 'utf8' });
3343
const maintainers = new Set(data.split('\n'));
3444
if (maintainers.has(actor)) {
3545
console.log(`🟢 ${actor} is a maintainer`);

.github/workflows/shared_label_core_team_prs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: (Shared) Label Core Team PRs
22

33
on:
4-
pull_request_target:
4+
pull_request:
55

66
env:
77
TZ: /usr/share/zoneinfo/America/Los_Angeles
@@ -10,7 +10,7 @@ env:
1010

1111
jobs:
1212
check_maintainer:
13-
uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main
13+
uses: facebook/react/.github/workflows/shared_check_maintainer.yml@pr32215
1414
with:
1515
actor: ${{ github.event.pull_request.user.login }}
1616

0 commit comments

Comments
 (0)