diff --git a/dsl/pact.go b/dsl/pact.go index f50f36de3..0f3d534d7 100644 --- a/dsl/pact.go +++ b/dsl/pact.go @@ -687,6 +687,7 @@ func (p *Pact) VerifyMessageProviderRaw(request VerifyMessageRequest) ([]types.P BrokerToken: request.BrokerToken, PublishVerificationResults: request.PublishVerificationResults, ProviderVersion: request.ProviderVersion, + TagWithGitBranch: request.TagWithGitBranch, ProviderTags: request.ProviderTags, Provider: p.Provider, PactLogDir: p.LogDir, diff --git a/dsl/verify_mesage_request.go b/dsl/verify_mesage_request.go index 28364ae5f..a360fa01c 100644 --- a/dsl/verify_mesage_request.go +++ b/dsl/verify_mesage_request.go @@ -60,6 +60,9 @@ type VerifyMessageRequest struct { // Useful for debugging issues with the framework itself PactLogLevel string + // Tag the provider with the current git branch in the Pact Broker + TagWithGitBranch bool + // Arguments to the VerificationProvider // Deprecated: This will be deleted after the native library replaces Ruby deps. Args []string @@ -103,5 +106,9 @@ func (v *VerifyMessageRequest) Validate() error { v.Args = append(v.Args, "--log-level", v.PactLogLevel) } + if v.TagWithGitBranch { + v.Args = append(v.Args, "--tag-with-git-branch", "true") + } + return nil } diff --git a/types/verify_request.go b/types/verify_request.go index 5d256cfbb..4b2ce4400 100644 --- a/types/verify_request.go +++ b/types/verify_request.go @@ -126,6 +126,9 @@ type VerifyRequest struct { // Deprecated Verbose bool + // Tag the provider with the current git branch in the Pact Broker + TagWithGitBranch bool + // Arguments to the VerificationProvider // Deprecated: This will be deleted after the native library replaces Ruby deps. Args []string @@ -246,5 +249,9 @@ func (v *VerifyRequest) Validate() error { v.Args = append(v.Args, "--log-level", v.PactLogLevel) } + if v.TagWithGitBranch { + v.Args = append(v.Args, "--tag-with-git-branch", "true") + } + return nil }