Skip to content

Commit

Permalink
fix: use provider_version_number from webhook context
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Aug 19, 2021
1 parent 09c11d3 commit 3cf421a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/pact_broker/webhooks/pact_and_verification_parameters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 3cf421a

Please sign in to comment.