Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display pull requests for external contributors w/DCO emails. #88

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dblock
Copy link
Member

@dblock dblock commented May 27, 2024

Description

Display pull requests for external contributors w/DCO emails.

CSV version:

      g.desc 'Display pull requests for external contributors.'
      g.command 'prs' do |c|
        c.action do |_global_options, options, _args|
          org = GitHub::Organization.new(options)
          GitHub::User.wrap(GitHub::Data.external_data) do |contributor|
            rate_limited do
              company = contributor.company&.strip&.gsub("\n\r  ", ' ')
              bio = contributor.bio&.strip&.gsub("\n\r  ", ' ')
              prs = GitHub::PullRequests.new($github.search_issues("org:#{org.name} state:merged is:pull-request archived:false is:closed merged:#{options[:from]}..#{options[:to]} author:#{contributor}", per_page: 10).items)
              # prs = GitHub::PullRequests.new({ org: org.name, status: :merged, author: contributor }.merge(options))
              prs_s = prs.map(&:to_s).join(", ")
              emails = prs.map(&:dco_signers).flatten.reject { |s| s.email.ends_with?('@users.noreply.github.com') }.first.to_s
              puts "https://github.com/#{contributor.login}|#{company}|#{emails}|#{prs_s}|#{bio}"
            end
          rescue StandardError => e
            puts "https://github.com/#{contributor.login}: #{e}\n"
          end
        end
      end

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant