Skip to content

Instantly share code, notes, and snippets.

@mariia-cherniuk
Created September 12, 2020 17:32
Show Gist options
  • Save mariia-cherniuk/c0877fd410cd3e0da0c52b5ab445e3c7 to your computer and use it in GitHub Desktop.
Save mariia-cherniuk/c0877fd410cd3e0da0c52b5ab445e3c7 to your computer and use it in GitHub Desktop.
desc "Merges develop into your feature branch \"Pre-push git hook\""
lane :merge_develop_if_needed do
current_branch = Actions.sh("git rev-parse --abbrev-ref HEAD")
next unless current_branch.start_with?(ENV['JIRA_PROJECT'])
Actions.sh("git fetch && git merge origin/#{ENV['DEVELOP_BRANCH']} --no-edit")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment