Module: RubocopAutomata::CI::CircleCI
- Defined in:
- lib/rubocop_automata/ci/circleci.rb
Overview
For CircleCI
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 |
# File 'lib/rubocop_automata/ci/circleci.rb', line 15 def base_branch ENV['CIRCLE_BRANCH'] end |
.pullrequest_description ⇒ Object
27 28 29 30 31 32 |
# File 'lib/rubocop_automata/ci/circleci.rb', line 27 def pullrequest_description <<~DESCRIPTION PR: #{ENV['CIRCLE_PULL_REQUEST']} Auto generated by [CircleCI](#{ENV['CIRCLE_BUILD_URL']}) DESCRIPTION end |
.pullrequest_title ⇒ Object
23 24 25 |
# File 'lib/rubocop_automata/ci/circleci.rb', line 23 def pullrequest_title "rubocop --auto-correct at #{`echo -n $(date)`}" end |
.repository_name ⇒ Object
11 12 13 |
# File 'lib/rubocop_automata/ci/circleci.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/circleci.rb', line 7 def repository_url "https://#{ENV['GITHUB_ACCESS_TOKEN']}@github.com/#{repository_name}" end |
.topic_branch ⇒ Object
19 20 21 |
# File 'lib/rubocop_automata/ci/circleci.rb', line 19 def topic_branch "ci/auto_correction-#{ENV['CIRCLE_BUILD_NUM']}" end |