A webhook is an HTTP callback that reacts to an event. In a Pact-based contract-testing pipeline, it closes the gap between separately maintained consumer and provider projects: when a consumer publishes a changed contract, the webhook can trigger provider verification automatically instead of waiting for a teammate to run it manually. section 10.4
Figure 10.15 Consumer and provider pipeline in different GitHub projects. When a consumer publishes a contract that has changed, this should trigger the provider verification job from the provider pipeline.
Use this flow when consumer and provider pipelines live in different GitHub projects. A changed consumer contract publishes an event, which triggers only the provider verification job and returns verification results to the Pact Broker. section 10.4
Configure a Pact webhook to dispatch provider verification:
- Create a GitHub personal access token with public_repo access, then store it as a PactFlow secret rather than placing it directly in the request. section 10.4.1
- Select the consumer and provider, then listen for the Contract Published That Requires Verification event. section 10.4.1
- Send a POST request to the GitHub repository dispatch endpoint with JSON headers, authorization, and a payload containing the pact URL, provider version SHA, and branch. section 10.4.1
- Configure the provider to use the webhook-supplied pact URLs so it verifies the newly amended contract; allow can-i-deploy to retry while verification remains unknown. section 10.5
A changed response expectation
Change a consumer expectation for GET /movies from status 200 to 201, commit, and push it. The consumer pipeline can fail can-i-deploy because the deployed provider has not verified the new contract; meanwhile, the webhook triggers the provider workflow, which reports the 200-versus-201 mismatch. section 10.4.5 section 10.4
Webhooks are an advanced part of contract-testing automation, alongside versioning and can-i-deploy. They provide a continuous feedback loop for contract changes, but the event configuration must match the workflow that should run. section 2.5.4 section 10.0





