Module: RubocopAutomata::CI::Local
- Defined in:
- lib/rubocop_automata/ci/local.rb
Overview
For localhost
Class Method Summary collapse
- .base_branch ⇒ Object
- .pullrequest_description ⇒ Object
- .pullrequest_title ⇒ Object
- .repository_name ⇒ Object
- .repository_url ⇒ Object
- .topic_branch ⇒ Object
Class Method Details
.base_branch ⇒ Object
15 16 17 18 19 20 |
# 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 ⇒ Object
30 31 32 33 34 35 |
# 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 ⇒ Object
26 27 28 |
# File 'lib/rubocop_automata/ci/local.rb', line 26 def pullrequest_title "rubocop --auto-correct at #{`echo -n $(date)`}" end |
.repository_name ⇒ Object
11 12 13 |
# 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 ⇒ Object
7 8 9 |
# File 'lib/rubocop_automata/ci/local.rb', line 7 def repository_url "https://#{ENV['GITHUB_ACCESS_TOKEN']}@github.com/#{repository_name}" end |
.topic_branch ⇒ Object
22 23 24 |
# File 'lib/rubocop_automata/ci/local.rb', line 22 def topic_branch @@topic_branch ||= "ci/auto_correction-#{Time.now.to_i}" end |