Skip to content

Commit 7023d1b

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

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
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`);

0 commit comments

Comments
 (0)