From 63264814a0f6fb109cd63f74f1c305367710b563 Mon Sep 17 00:00:00 2001 From: Dominik Kapusta Date: Wed, 2 Oct 2024 06:54:42 -0400 Subject: [PATCH] Use repo_name helper function in asana_find_release_task_action --- .../actions/asana_find_release_task_action.rb | 7 ++++--- spec/asana_find_release_task_action_spec.rb | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/fastlane/plugin/ddg_apple_automation/actions/asana_find_release_task_action.rb b/lib/fastlane/plugin/ddg_apple_automation/actions/asana_find_release_task_action.rb index 3cdf2ad..b788cc5 100644 --- a/lib/fastlane/plugin/ddg_apple_automation/actions/asana_find_release_task_action.rb +++ b/lib/fastlane/plugin/ddg_apple_automation/actions/asana_find_release_task_action.rb @@ -5,6 +5,7 @@ require "time" require_relative "../helper/asana_helper" require_relative "../helper/ddg_apple_automation_helper" +require_relative "../helper/git_helper" require_relative "../helper/github_actions_helper" module Fastlane @@ -37,7 +38,7 @@ def self.run(params) platform = params[:platform] || Actions.lane_context[Actions::SharedValues::PLATFORM_NAME] setup_constants(platform) - latest_marketing_version = find_latest_marketing_version(github_token) + latest_marketing_version = find_latest_marketing_version(github_token, params[:platform]) release_task_id = find_release_task(latest_marketing_version, asana_access_token) release_task_url = Helper::AsanaHelper.asana_task_url(release_task_id) @@ -55,11 +56,11 @@ def self.run(params) } end - def self.find_latest_marketing_version(github_token) + def self.find_latest_marketing_version(github_token, platform) client = Octokit::Client.new(access_token: github_token) # NOTE: `client.latest_release` returns release marked as "latest", i.e. a public release - latest_internal_release = client.releases(@constants[:repo_name], { per_page: 1 }).first + latest_internal_release = client.releases(Helper::GitHelper.repo_name(platform), { per_page: 1 }).first version = extract_version_from_tag_name(latest_internal_release&.tag_name) if version.to_s.empty? diff --git a/spec/asana_find_release_task_action_spec.rb b/spec/asana_find_release_task_action_spec.rb index db6400b..ecc53a3 100644 --- a/spec/asana_find_release_task_action_spec.rb +++ b/spec/asana_find_release_task_action_spec.rb @@ -63,7 +63,7 @@ def test_action(platform) end def find_latest_marketing_version - Fastlane::Actions::AsanaFindReleaseTaskAction.find_latest_marketing_version("token") + Fastlane::Actions::AsanaFindReleaseTaskAction.find_latest_marketing_version("token", "ios") end end