Skip to content

Commit

Permalink
feat: support publish pacts with branch for v1.x (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F authored Apr 23, 2024
1 parent fcfa5c5 commit 0d81b71
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions types/publish_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
}
Expand Down

0 comments on commit 0d81b71

Please sign in to comment.