Skip to content

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

Open
dblock wants to merge 1 commit into
opensearch-project:mainfrom
dblock:repo-contributors
Open

Display pull requests for external contributors w/DCO emails.#88
dblock wants to merge 1 commit into
opensearch-project:mainfrom
dblock:repo-contributors

Conversation

@dblock

@dblock dblock commented May 27, 2024

Copy link
Copy Markdown
Member

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.

Signed-off-by: dblock <dblock@amazon.com>
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