diff --git a/lib/pact_broker/webhooks/pact_and_verification_parameters.rb b/lib/pact_broker/webhooks/pact_and_verification_parameters.rb index 427024f19..6b8c91925 100644 --- a/lib/pact_broker/webhooks/pact_and_verification_parameters.rb +++ b/lib/pact_broker/webhooks/pact_and_verification_parameters.rb @@ -52,7 +52,7 @@ def to_hash PACT_URL => pact ? PactBroker::Api::PactBrokerUrls.pact_version_url_with_webhook_metadata(pact, base_url) : "", VERIFICATION_RESULT_URL => verification_url, CONSUMER_VERSION_NUMBER => consumer_version_number, - PROVIDER_VERSION_NUMBER => verification ? verification.provider_version_number : "", + PROVIDER_VERSION_NUMBER => provider_version_number, PROVIDER_VERSION_TAGS => provider_version_tags, PROVIDER_VERSION_BRANCH => provider_version_branch, CONSUMER_VERSION_TAGS => consumer_version_tags, @@ -146,6 +146,14 @@ def provider_version_tags end end + def provider_version_number + if webhook_context[:provider_version_number] + webhook_context[:provider_version_number] + else + verification ? verification.provider_version_number : "" + end + end + def provider_version_branch if webhook_context[:provider_version_branch] webhook_context[:provider_version_branch]