Simple script to list all PRs in an organisation.
TO run the script you will need to pass an environment variable.
GH_AUTH_TOKEN=YOUR_GIT_AUTH_TOKEN ./prs
gem 'octokit' |
#!/usr/bin/env ruby | |
require 'octokit' | |
client = Octokit::Client.new(access_token: ENV['GH_AUTH_TOKEN']) | |
mas = 'moneyadviceservice' | |
repositories = client.organization_repositories(mas, per_page: 200) | |
repositories.map do |repository| | |
repository_name = "#{mas}/#{repository.name}" | |
pulls = client.pull_requests(repository_name, state: 'open') | |
next if pulls.empty? | |
pulls.each do |pull| | |
puts "#{pull.title} - #{pull.html_url}" | |
end | |
end | |