From 82e2c826665b2470fb93fa09cd88ed6e88f0989d Mon Sep 17 00:00:00 2001 From: Patrick Honkonen <1883101+SaintPatrck@users.noreply.github.com> Date: Thu, 27 Jun 2024 17:15:17 -0400 Subject: [PATCH] [PM-8985] Fetch all tags when checking out repo for build job (#3371) --- fastlane/Fastfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index a778bf7a0f..aadcf46f84 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -126,9 +126,11 @@ platform :android do currentVersionName = buildConfigText.match(/versionName = "(.+)"/).captures[0] if options[:versionName].nil? or options[:versionName].to_s.empty? + puts "Fetching latest tags from origin..." + `git fetch --prune --no-recurse-submodules --filter=tree:0 --depth=1 --tags origin` puts "Getting latest version name from previous git tag..." - latestTag = `git tag --sort=committerdate --list | tail -1` - puts "Using previous tag (#{latestTag}) to calculate version name..." + latestTag = `git describe --tags $(git rev-list --tags --max-count=1)`.chomp() + puts "Using tag #{latestTag} to calculate version name..." latestTag.slice!(0) puts "Current version name resolved to #{latestTag}."