Skip to content
Latchkey

How to Trigger Provider Verification With Broker Webhooks

A broker webhook fires on the contract-requiring-verification event and calls your provider CI so verification runs the moment a consumer changes.

Create a webhook that POSTs to the GitHub dispatches API on the contract_requiring_verification_published event, then handle repository_dispatch in the provider workflow.

Steps

  • Create a webhook in the broker on the contract-requiring-verification event.
  • Point it at the provider repo dispatches endpoint with a token.
  • Handle repository_dispatch in the provider workflow to run verification.

Provider workflow

.github/workflows/verify.yml
on:
  repository_dispatch:
    types: [contract_requiring_verification_published]
jobs:
  verify:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.client_payload.sha }}
      - run: npm ci && npm run test:provider

Gotchas

  • The broker template variables (like pactUrl and consumerVersionNumber) must be passed in the webhook body so the provider verifies the exact contract.
  • Scope the dispatch token to the provider repo only.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →