When calling other actions, you should be using the other_action method. Ex. other_action.git_branch. Using the ruby module Actions can and will result in unexpected behaviors, like we've recently encountered in a project we've been working on. More details below.
When using this plugin with our CI (Bitrise), we were getting failures that said, [!] Cannot find version number in git branch 'HEAD' by pattern 'v#'. We began digging and found the problem to be the use of the Actions.git_branch instead of other_action.git_branch. This is because when using Actions.git_branch, this is not calling into the git_branch plugin but instead is calling a class method on the Actions module. These are two totally separate things and it appears the use of Actions.git_branch isn't meant to be used in third party plugins such as this one.
Using Actions.git_branch:
$ be fastlane run get_version_number_from_git_branch pattern:'v#'
[✔] 🚀
+----------------------------+---------+--------------------------------------------------------------------------------------------------------------------+
| Used plugins |
+----------------------------+---------+--------------------------------------------------------------------------------------------------------------------+
| Plugin | Version | Action |
+----------------------------+---------+--------------------------------------------------------------------------------------------------------------------+
| fastlane-plugin-git_tags | 0.1.1 | git_tags |
| fastlane-plugin-versioning | 0.3.4 | get_version_number_from_git_branch get_version_number_from_plist get_build_number_from_plist ci_build_number |
| | | increment_version_number_in_plist get_app_store_version_number get_info_plist_path increment_build_number_in_plist |
+----------------------------+---------+--------------------------------------------------------------------------------------------------------------------+
[10:13:44]: ------------------------------------------------
[10:13:44]: --- Step: get_version_number_from_git_branch ---
[10:13:44]: ------------------------------------------------
[!] Cannot find version number in git branch 'HEAD' by pattern 'v#'
When calling other actions, you should be using the other_action method. Ex.
other_action.git_branch
. Using the ruby moduleActions
can and will result in unexpected behaviors, like we've recently encountered in a project we've been working on. More details below.When using this plugin with our CI (Bitrise), we were getting failures that said,
[!] Cannot find version number in git branch 'HEAD' by pattern 'v#'
. We began digging and found the problem to be the use of theActions.git_branch
instead ofother_action.git_branch
. This is because when usingActions.git_branch
, this is not calling into thegit_branch
plugin but instead is calling a class method on theActions
module. These are two totally separate things and it appears the use ofActions.git_branch
isn't meant to be used in third party plugins such as this one.Using
Actions.git_branch
:Using
other_action.git_branch
: