Skip to content

Commit

Permalink
chore: Add branch to published pacts #1714
Browse files Browse the repository at this point in the history
  • Loading branch information
rholshausen committed Apr 22, 2024
1 parent e7d501d commit fc5c5fa
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pact-publish/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
}
}

Expand All @@ -27,13 +27,23 @@ 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 {
pactBrokerUrl = 'https://pact-foundation.pactflow.io'
if (project.hasProperty('pactBrokerToken')) {
pactBrokerToken = project.pactBrokerToken
}
consumerBranch = gitBranch()
excludes = ['JVM Pact Broker Client-Imaginary Pact Broker']
}
}
Expand Down

0 comments on commit fc5c5fa

Please sign in to comment.