Pact consumerVersionSelectors returns no pacts in CI
consumerVersionSelectors tell the provider which consumer pact versions to verify. If the selectors reference a branch, tag, or environment that has no matching published pacts, the verifier fetches an empty set and verifies nothing.
What this error means
Provider verification reports zero interactions and the log shows the configured selectors returned no pacts, often after switching from tags to branches.
INFO: Selecting pacts using consumerVersionSelectors:
[{"tag":"prod"}]
WARN: No pacts found matching selectors. Did you mean mainBranch or deployedOrReleased?Common causes
Selectors use a tag or branch with no pacts
The selector targets a tag or branch that no consumer has published against, so nothing matches.
Deprecated tag selectors after moving to branches
The project migrated consumers to branch-based publishing but the selectors still filter by an old tag.
How to fix it
Use branch and deployed selectors
- Replace stale tag selectors with
mainBranchanddeployedOrReleased. - Confirm consumers publish with a matching branch.
- Re-run and verify pacts are now selected.
consumerVersionSelectors: [
{ mainBranch: true },
{ deployedOrReleased: true },
{ matchingBranch: true },
]Confirm what is published for the consumer
List the consumer versions and their branches in the broker to pick selectors that actually match.
pact-broker describe-version \
--pacticipant web-consumer --latest \
--broker-base-url "$PACT_BROKER_BASE_URL"How to prevent it
- Prefer
mainBranch/deployedOrReleasedselectors over hardcoded tags. - Keep consumer publish branches aligned with provider selectors.
- Fail the build when selectors return zero pacts.