https://github.com/pulls?user=matrix-hacks replace matrix-hacks with your own
Last active
February 14, 2025 20:02
-
-
Save kfatehi/ff12772c852da1fe8a2c88a5e3f1bfb3 to your computer and use it in GitHub Desktop.
list pull requests across entire organization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Promise = require('bluebird') | |
var GitHubApi = require("github"); | |
const org = "matrix-hacks"; | |
var github = new GitHubApi({ Promise }); | |
github.repos.getForOrg({ org, type: 'sources' }) | |
.then(res=>res.data.map(i=>i.name)) | |
.then(repos=>{ | |
return Promise.map(repos, (repo) => { | |
return github.pullRequests.getAll({ | |
state: 'open', | |
owner: org, | |
repo | |
}); | |
}) | |
}) | |
.then((allReposPrs) => { | |
allReposPrs.forEach(thisRepoPrs=>{ | |
thisRepoPrs.data.forEach(pr => { | |
const { | |
_links, | |
title, | |
body, | |
created_at, | |
updated_at, | |
user: { login }, | |
number, | |
} = pr; | |
const baseName = pr.base.repo.name; | |
console.log([ | |
`Pull request`, | |
`\tRepo: ${pr.base.repo.name}`, | |
`\tAuthor: ${login}`, | |
`\tTitle: ${title}`, | |
`\tURL: ${_links.html.href}`, | |
].join('\n')); | |
}); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!