forked from MyZubster-Ecosystem/myzubster
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcollect-payments.js
More file actions
49 lines (42 loc) 路 1.33 KB
/
Copy pathcollect-payments.js
File metadata and controls
49 lines (42 loc) 路 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const { execSync } = require('child_process');
const fs = require('fs');
// Repository da controllare
const repos = [
{ name: 'myzubster', path: '../myzubster' },
{ name: 'my-monero-bounty', path: '../my-monero-bounty' },
{ name: 'MyZubsterGateway', path: '../MyZubsterGateway' },
{ name: 'tokenization-singapore', path: '../tokenization-singapore' },
{ name: 'MyZubsterWeb', path: '../MyZubsterWeb' }
];
// Cerca bounty nelle issue
function findBounties() {
const payments = [];
repos.forEach(repo => {
try {
// Cerca issue con bounty
const issues = execSync(
`cd ${repo.path} && gh issue list --json number,title,labels,comments --limit 50`,
{ encoding: 'utf8' }
);
const data = JSON.parse(issues);
data.forEach(issue => {
const hasBounty = issue.labels.some(l =>
l.name.includes('bounty') || l.name.includes('馃挵')
);
if (hasBounty) {
payments.push({
repo: repo.name,
issue: issue.number,
title: issue.title,
labels: issue.labels.map(l => l.name)
});
}
});
} catch (error) {
console.error(`Errore per ${repo.name}:`, error.message);
}
});
return payments;
}
const bounties = findBounties();
console.log(JSON.stringify(bounties, null, 2));