Class: TeachersPet::Actions::MergePullRequests

Inherits:
Base
  • Object
show all
Defined in:
lib/teachers_pet/actions/merge_pull_requests.rb

Instance Attribute Summary

Attributes inherited from Base

#client, #options

Instance Method Summary collapse

Methods inherited from Base

#execute, #init_client, #initialize, #octokit_config, #read_file, #read_members_file, #read_students_file

Constructor Details

This class inherits a constructor from TeachersPet::Actions::Base

Instance Method Details

#runObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/teachers_pet/actions/merge_pull_requests.rb', line 4

def run
  repository = self.options[:repository]

  self.init_client

  open_pull_requests = self.client.pull_requests(repository, state: 'open')
  open_pull_requests.each do |pr|
    print "Merging #{pr.html_url}..."
    client.merge_pull_request(repository, pr.number)
    puts "done"
  end
end