mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-17 15:23:08 -07:00
22 lines
761 B
JavaScript
22 lines
761 B
JavaScript
import { execSync } from 'node:child_process';
|
|
|
|
try {
|
|
const repoInfo = execSync('gh repo view --json nameWithOwner', { encoding: 'utf-8' });
|
|
const repo = JSON.parse(repoInfo).nameWithOwner;
|
|
const output = execSync(`gh search prs --state open --repo ${repo} --limit 1000 --json authorAssociation`, { encoding: 'utf-8' });
|
|
const prs = JSON.parse(output);
|
|
const communityPrs = prs.filter(pr =>
|
|
pr.authorAssociation !== 'MEMBER' &&
|
|
pr.authorAssociation !== 'OWNER' &&
|
|
pr.authorAssociation !== 'COLLABORATOR'
|
|
);
|
|
process.stdout.write(JSON.stringify({
|
|
metric: 'open_community_prs',
|
|
value: communityPrs.length,
|
|
timestamp: new Date().toISOString()
|
|
}));
|
|
} catch (err) {
|
|
process.stderr.write(err.message);
|
|
process.exit(1);
|
|
}
|