Skip to content

Commit 7204ec4

Browse files
committed
feat: support contract_requiring_verification_published_webhook flow
1 parent 0f5b3f1 commit 7204ec4

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Makefile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PACTICIPANT := "pactflow-example-provider-java-graphql"
2-
WEBHOOK_UUID := "9GS-Z8nSAbUzvJW4xmhdsg"
3-
PACT_CHANGED_WEBHOOK_UUID := "c76b601e-d66a-4eb1-88a4-6ebc50c0df8b"
2+
GITHUB_REPO := "pactflow/pactflow-example-provider-java-graphql"
3+
CONTRACT_REQUIRING_VERIFICATION_PUBLISHED_WEBHOOK_UUID := "c76b601e-d66a-4eb1-88a4-6ebc50c0df8b"
44
PACT_CLI="docker run --rm -v ${PWD}:${PWD} -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN pactfoundation/pact-cli"
55

66
# Only deploy from main
@@ -76,20 +76,20 @@ create_github_token_secret:
7676

7777
# NOTE: the github token secret must be created (either through the UI or using the
7878
# `create_github_token_secret` target) before the webhook is invoked.
79-
create_or_update_pact_changed_webhook:
79+
create_or_update_contract_requiring_verification_published_webhook:
8080
"${PACT_CLI}" \
8181
broker create-or-update-webhook \
8282
"https://api.github.com/repos/${GITHUB_REPO}/dispatches" \
8383
--header 'Content-Type: application/json' 'Accept: application/vnd.github.everest-preview+json' 'Authorization: Bearer $${user.githubToken}' \
8484
--request POST \
85-
--data '{ "event_type": "pact_changed", "client_payload": { "pact_url": "$${pactbroker.pactUrl}" } }' \
86-
--uuid ${PACT_CHANGED_WEBHOOK_UUID} \
87-
--consumer ${PACTICIPANT} \
88-
--contract-content-changed \
89-
--description "Pact content changed for ${PACTICIPANT}"
90-
91-
test_pact_changed_webhook:
92-
@curl -v -X POST ${PACT_BROKER_BASE_URL}/webhooks/${PACT_CHANGED_WEBHOOK_UUID}/execute -H "Authorization: Bearer ${PACT_BROKER_TOKEN}"
85+
--data '{ "event_type": "contract_requiring_verification_published","client_payload": { "pact_url": "$${pactbroker.pactUrl}", "sha": "$${pactbroker.providerVersionNumber}", "branch":"$${pactbroker.providerVersionBranch}" , "message": "Verify changed pact for $${pactbroker.consumerName} version $${pactbroker.consumerVersionNumber} branch $${pactbroker.consumerVersionBranch} by $${pactbroker.providerVersionNumber} ($${pactbroker.providerVersionDescriptions})" } }' \
86+
--uuid ${CONTRACT_REQUIRING_VERIFICATION_PUBLISHED_WEBHOOK_UUID} \
87+
--provider ${PACTICIPANT} \
88+
--contract-requiring-verification-published \
89+
--description "contract_requiring_verification_published for ${PACTICIPANT}"
90+
91+
test_contract_requiring_verification_published_webhook:
92+
@curl -v -X POST ${PACT_BROKER_BASE_URL}/webhooks/${CONTRACT_REQUIRING_VERIFICATION_PUBLISHED_WEBHOOK_UUID}/execute -H "Authorization: Bearer ${PACT_BROKER_TOKEN}"
9393

9494
## ======================
9595
## Misc

0 commit comments

Comments
 (0)