Skip to content

Commit 9ac31b3

Browse files
committed
fix: remove duplicate issues
1 parent 968b2b4 commit 9ac31b3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

run.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const pkg = require('./package.json')
9292
}
9393
}
9494

95-
let agendaIssues = []
95+
const agendaIssues = []
9696
for (const r of repos) {
9797
console.log(`Fetching issues for ${r.owner}/${r.repo}`)
9898
const _agendaIssues = await client.paginate('GET /repos/{owner}/{repo}/issues', {
@@ -101,8 +101,14 @@ const pkg = require('./package.json')
101101
state: 'open',
102102
labels: agendaLabel
103103
})
104-
agendaIssues = agendaIssues.concat(_agendaIssues)
104+
for (const i of _agendaIssues) {
105+
if (!agendaIssues.find((ii) => ii.url === i.url)) {
106+
agendaIssues.push(i)
107+
break
108+
}
109+
}
105110
}
111+
106112
const opts = {
107113
...repo,
108114
schedules,

0 commit comments

Comments
 (0)