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") }