From 0d81b7132ced239de782686270028d9143062e18 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Tue, 23 Apr 2024 06:40:39 +0100 Subject: [PATCH] feat: support publish pacts with branch for v1.x (#374) --- types/publish_request.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/types/publish_request.go b/types/publish_request.go index b5f41b12f..8ea624299 100644 --- a/types/publish_request.go +++ b/types/publish_request.go @@ -29,6 +29,11 @@ type PublishRequest struct { // e.g. "production", "master" and "development" are some common examples. Tags []string + // Branches are used to identify which pacts a provider should verify using + // consumer version selectors, associating the consumer API version with + // a branch. This supersedes tags. https://docs.pact.io/pact_broker/branches + Branch string + // Verbose increases verbosity of output // Deprecated Verbose bool @@ -71,6 +76,10 @@ func (p *PublishRequest) Validate() error { p.Args = append(p.Args, "--broker-token", p.BrokerToken) } + if p.Branch != "" { + p.Args = append(p.Args, "--branch", p.Branch) + } + if p.ConsumerVersion == "" { return fmt.Errorf("'ConsumerVersion' is mandatory") }