Class: Fastlane::Actions::PushToGitRemoteAction
- Inherits:
-
Fastlane::Action
- Object
- Fastlane::Action
- Fastlane::Actions::PushToGitRemoteAction
- Defined in:
- lib/fastlane/actions/push_to_git_remote.rb
Overview
Adds a git tag to the current commit
Class Method Summary collapse
Methods inherited from Fastlane::Action
Class Method Details
.author ⇒ Object
45 46 47 |
# File 'lib/fastlane/actions/push_to_git_remote.rb', line 45 def self. "lmirosevic" end |
.available_options ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/fastlane/actions/push_to_git_remote.rb', line 36 def self. [ ['remote', 'The remote to push to. Defaults to `origin`'], ['branch', 'The local branch to push from. Defaults to the current branch'], ['branch', 'The remote branch to push to. Defaults to the local branch'], ['force', 'Force push to remote. Defaults to false'] ] end |
.description ⇒ Object
32 33 34 |
# File 'lib/fastlane/actions/push_to_git_remote.rb', line 32 def self.description "Push local changes to the remote branch" end |
.run(params) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/fastlane/actions/push_to_git_remote.rb', line 5 def self.run(params) = params.first remote = ( && [:remote]) || 'origin' force = ( && [:force]) || false local_branch = ( && ([:local_branch] || [:branch])) || Actions.git_branch.gsub(/#{remote}\//, '') || 'master' remote_branch = ( && [:remote_branch]) || local_branch # construct our command as an array of components command = [ 'git', 'push', remote, "#{local_branch}:#{remote_branch}", '--tags' ] # optionally add the force component command << '--force' if force # execute our command puts Actions.sh('pwd') Actions.sh(command.join(' ')) Helper.log.info 'Sucesfully pushed to remote.' end |