diff --git a/lib/pact/pact_broker/fetch_pacts.rb b/lib/pact/pact_broker/fetch_pacts.rb index 002a6afa..972fd602 100644 --- a/lib/pact/pact_broker/fetch_pacts.rb +++ b/lib/pact/pact_broker/fetch_pacts.rb @@ -34,11 +34,15 @@ def self.call(provider, tags, broker_base_url, basic_auth_options) def call get_index - tags&.any? ? get_tagged_pacts_for_provider : get_latest_pacts_for_provider + tag_exist ? get_tagged_pacts_for_provider : get_latest_pacts_for_provider end private + def tag_exist + tags && tags.any? + end + def get_tagged_pacts_for_provider tags.collect do |tag| link = get_link(tag)