Skip to content

Commit

Permalink
Use repo_name helper function in asana_find_release_task_action
Browse files Browse the repository at this point in the history
ayoy committed Oct 2, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 918b608 commit 6326481
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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?
2 changes: 1 addition & 1 deletion spec/asana_find_release_task_action_spec.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6326481

Please sign in to comment.