From eef0810ba47969536438643985a0647c0803ddfd Mon Sep 17 00:00:00 2001 From: Ronald Holshausen Date: Wed, 15 Nov 2023 15:23:19 +1100 Subject: [PATCH] chore: Add branch to published pacts #1714 --- pact-publish/build.gradle | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pact-publish/build.gradle b/pact-publish/build.gradle index 9c899b34b..856bcde06 100644 --- a/pact-publish/build.gradle +++ b/pact-publish/build.gradle @@ -1,6 +1,6 @@ buildscript { dependencies { - classpath 'au.com.dius.pact.provider:gradle:4.3.18' + classpath 'au.com.dius.pact.provider:gradle:4.5.8' } } @@ -27,6 +27,15 @@ dependencies { testRuntimeOnly 'ch.qos.logback:logback-classic' } +def gitBranch() { + def branch = "" + def proc = "git rev-parse --abbrev-ref HEAD".execute() + proc.in.eachLine { line -> branch = line } + proc.err.eachLine { line -> println line } + proc.waitFor() + branch +} + if (System.env.PACT_PUBLISH == 'true') { pact { publish { @@ -34,6 +43,7 @@ if (System.env.PACT_PUBLISH == 'true') { if (project.hasProperty('pactBrokerToken')) { pactBrokerToken = project.pactBrokerToken } + consumerBranch = gitBranch() excludes = ['JVM Pact Broker Client-Imaginary Pact Broker'] } }