module RubocopAutomata::CI::Local

For localhost

Public Instance Methods

base_branch() click to toggle source
# File lib/rubocop_automata/ci/local.rb, line 15
def base_branch
  if ENV['AUTOMATA_BASE_BRANCH'].nil?
    raise 'Please input ENV of AUTOMATA_BASE_BRANCH'
  end
  ENV['AUTOMATA_BASE_BRANCH']
end
pullrequest_description() click to toggle source
# File lib/rubocop_automata/ci/local.rb, line 30
      def pullrequest_description
        <<~DESCRIPTION
          PR: https://github.com/#{repository_name}/pull/:id
          Auto generated by localhost
        DESCRIPTION
      end
pullrequest_title() click to toggle source
# File lib/rubocop_automata/ci/local.rb, line 26
def pullrequest_title
  "rubocop --auto-correct at #{`echo -n $(date)`}"
end
repository_name() click to toggle source
# File lib/rubocop_automata/ci/local.rb, line 11
def repository_name
  /^.+?github.com[:\/](?<repository_name>.+?)\.git$/.match(`git config --get remote.origin.url`)[:repository_name]
end
repository_url() click to toggle source
# File lib/rubocop_automata/ci/local.rb, line 7
def repository_url
  "https://#{ENV['GITHUB_ACCESS_TOKEN']}@github.com/#{repository_name}"
end
topic_branch() click to toggle source
# File lib/rubocop_automata/ci/local.rb, line 22
def topic_branch
  @@topic_branch ||= "ci/auto_correction-#{Time.now.to_i}"
end