diff --git a/lib/fastlane/plugin/ddg_apple_automation/assets/mattermost_send_message/templates/notarized-build-complete.txt.erb b/lib/fastlane/plugin/ddg_apple_automation/assets/mattermost_send_message/templates/notarized-build-complete.txt.erb index c7e64a8..40758e6 100644 --- a/lib/fastlane/plugin/ddg_apple_automation/assets/mattermost_send_message/templates/notarized-build-complete.txt.erb +++ b/lib/fastlane/plugin/ddg_apple_automation/assets/mattermost_send_message/templates/notarized-build-complete.txt.erb @@ -1 +1 @@ -Notarized macOS app `<%= release_type %>` build is ready :goose_honk_tada: | [:github: Workflow run summary](<%= workflow_url %>)<% if defined?(asana_task_url) %> | [:asana: Asana Task](<%= asana_task_url %>)<% end %> \ No newline at end of file +Notarized macOS app `<%= release_type %>` build is ready :goose_honk_tada: | [:github: Workflow run summary](<%= workflow_url %>)<% if defined?(asana_task_url) && !asana_task_url.to_s.strip.empty? %> | [:asana: Asana Task](<%= asana_task_url %>)<% end %> \ No newline at end of file diff --git a/lib/fastlane/plugin/ddg_apple_automation/assets/mattermost_send_message/templates/notarized-build-failed.txt.erb b/lib/fastlane/plugin/ddg_apple_automation/assets/mattermost_send_message/templates/notarized-build-failed.txt.erb index e2105c0..c25fee7 100644 --- a/lib/fastlane/plugin/ddg_apple_automation/assets/mattermost_send_message/templates/notarized-build-failed.txt.erb +++ b/lib/fastlane/plugin/ddg_apple_automation/assets/mattermost_send_message/templates/notarized-build-failed.txt.erb @@ -1 +1 @@ -:rotating_light: Notarized macOS app `<%= release_type %>` build failed | [:github: Workflow run summary](<%= workflow_url %>)<% if defined?(asana_task_url) %> | [:asana: Asana Task](<%= asana_task_url %>)<% end %> \ No newline at end of file +:rotating_light: Notarized macOS app `<%= release_type %>` build failed | [:github: Workflow run summary](<%= workflow_url %>)<% if defined?(asana_task_url) && !asana_task_url.to_s.strip.empty? %> | [:asana: Asana Task](<%= asana_task_url %>)<% end %> \ No newline at end of file diff --git a/lib/fastlane/plugin/ddg_apple_automation/version.rb b/lib/fastlane/plugin/ddg_apple_automation/version.rb index 712598a..e532462 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.6" + VERSION = "0.11.7" end end diff --git a/spec/mattermost_send_message_action_spec.rb b/spec/mattermost_send_message_action_spec.rb index 814b3fc..50cb517 100644 --- a/spec/mattermost_send_message_action_spec.rb +++ b/spec/mattermost_send_message_action_spec.rb @@ -75,6 +75,26 @@ })).to eq(expected) end + it "processes notarized-build-complete template with a nil asana_task_url" do + expected = "Notarized macOS app `release` build is ready :goose_honk_tada: | [:github: Workflow run summary](https://workflow.com)" + + expect(process_template("notarized-build-complete", { + "release_type" => "release", + "workflow_url" => "https://workflow.com", + "asana_task_url" => nil + })).to eq(expected) + end + + it "processes notarized-build-complete template with an empty asana_task_url" do + expected = "Notarized macOS app `release` build is ready :goose_honk_tada: | [:github: Workflow run summary](https://workflow.com)" + + expect(process_template("notarized-build-complete", { + "release_type" => "release", + "workflow_url" => "https://workflow.com", + "asana_task_url" => "" + })).to eq(expected) + end + it "processes notarized-build-complete template with Asana task URL" do expected = "Notarized macOS app `release` build is ready :goose_honk_tada: | [:github: Workflow run summary](https://workflow.com) | [:asana: Asana Task](https://asana.com)"