diff --git a/run.js b/run.js index a574fd8..d2295fe 100644 --- a/run.js +++ b/run.js @@ -103,6 +103,7 @@ const pkg = require('./package.json') state: 'open', labels: agendaLabel }) + console.log(`Fetching issues for ${r.owner}/${r.repo}: Found ${_agendaIssues.length}`) for (const i of _agendaIssues) { console.log(`Adding Issue: ${i.url}`) @@ -110,6 +111,23 @@ const pkg = require('./package.json') agendaIssues.push(i) } } + + const _agendaPr = await client.paginate('GET /repos/{owner}/{repo}/pulls', { + owner: r.owner, + repo: r.repo, + state: 'open', + labels: agendaLabel + }) + + for (const pr of _agendaPr) { + if (pr.labels.some(label => label.name === agendaLabel)) { + console.log(`Fetching PRs for ${r.owner}/${r.repo}: Found ${_agendaPr.length}`) + if (!agendaIssues.find((ii) => ii.url === pr.url)) { + console.log(`Adding PR: ${pr.url}`) + agendaIssues.push(pr) + } + } + } } console.log(`Found ${agendaIssues.length} total issues for agenda`)