From 689c9c81d6f7265671cd2d84c196a59222e38582 Mon Sep 17 00:00:00 2001 From: kshann Date: Tue, 19 Nov 2024 00:51:52 +1100 Subject: [PATCH] Bugfix for asset mapping path (#17) --- .../ddg_apple_automation/helper/asana_helper.rb | 2 +- .../plugin/ddg_apple_automation/version.rb | 2 +- spec/asana_helper_spec.rb | 17 ++--------------- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/lib/fastlane/plugin/ddg_apple_automation/helper/asana_helper.rb b/lib/fastlane/plugin/ddg_apple_automation/helper/asana_helper.rb index 7bbaa52..449260c 100644 --- a/lib/fastlane/plugin/ddg_apple_automation/helper/asana_helper.rb +++ b/lib/fastlane/plugin/ddg_apple_automation/helper/asana_helper.rb @@ -106,7 +106,7 @@ def self.get_release_automation_subtask_id(task_url, asana_access_token) end def self.get_asana_user_id_for_github_handle(github_handle) - mapping_file = File.expand_path('../assets/github-asana-user-id-mapping.yml', __dir__) + mapping_file = Helper::DdgAppleAutomationHelper.path_for_asset_file('asana_get_user_id_for_github_handle/github-asana-user-id-mapping.yml') user_mapping = YAML.load_file(mapping_file) asana_user_id = user_mapping[github_handle] diff --git a/lib/fastlane/plugin/ddg_apple_automation/version.rb b/lib/fastlane/plugin/ddg_apple_automation/version.rb index 0d8ee25..3bbfd01 100644 --- a/lib/fastlane/plugin/ddg_apple_automation/version.rb +++ b/lib/fastlane/plugin/ddg_apple_automation/version.rb @@ -1,5 +1,5 @@ module Fastlane module DdgAppleAutomation - VERSION = "0.11.3" + VERSION = "0.11.4" end end diff --git a/spec/asana_helper_spec.rb b/spec/asana_helper_spec.rb index 7c2844f..c25d83c 100644 --- a/spec/asana_helper_spec.rb +++ b/spec/asana_helper_spec.rb @@ -140,24 +140,11 @@ def get_release_automation_subtask_id(task_url) end describe "#get_asana_user_id_for_github_handle" do - let(:yaml_content) do - { - "duck" => "123", - "goose" => "456", - "pigeon" => nil, - "hawk" => "" - } - end - - before do - allow(YAML).to receive(:load_file).and_return(yaml_content) - end - it "sets the user ID output and GHA output correctly" do allow(Fastlane::Helper::GitHubActionsHelper).to receive(:set_output) - expect(get_asana_user_id_for_github_handle("duck")).to eq("123") - expect(Fastlane::Helper::GitHubActionsHelper).to have_received(:set_output).with("asana_user_id", "123") + expect(get_asana_user_id_for_github_handle("jotaemepereira")).to eq("1203972458584419") + expect(Fastlane::Helper::GitHubActionsHelper).to have_received(:set_output).with("asana_user_id", "1203972458584419") end it "shows warning when handle does not exist" do