Skip to content

Commit

Permalink
Adding Huborg::Client#synchronize_mailmap!
Browse files Browse the repository at this point in the history
The method will take a given template (which confirms to [Git's
.mailmap file format](https://www.git-scm.com/docs/git-check-mailmap),
then iterates on all of the repositories, adding any non-duplicates,
then writing back to the template before creating pull requests against
each of the organization's non-archived repositories.
  • Loading branch information
jeremyf committed Feb 28, 2020
1 parent 2d42470 commit d378bd2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,13 @@ namespace :test do
)
client.audit_license
end

task :mailmap do
require 'huborg'
client = Huborg::Client.new(
github_access_token: ENV.fetch("GITHUB_ACCESS_TOKEN"),
org_names: ENV.fetch("GITHUB_ORG_NAME")
)
client.synchronize_mailmap!(template: ENV.fetch("MAILMAP_TEMPLATE_FILENAME"))
end
end
2 changes: 1 addition & 1 deletion lib/huborg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def audit_license(skip_private: true, skip_archived: true, allowed_licenses: :al
def synchronize_mailmap!(template:, consolidated_template: template)
mailmap_lines = Set.new
File.read(template).split("\n").each do |line|
mailmap_lines << line unless line.blank?
mailmap_lines << line unless line.empty?
end

each_github_repository do |repo|
Expand Down

0 comments on commit d378bd2

Please sign in to comment.