It seems that when requesting traction, two remote controls are required to track the build result for both (at least I did not return the results to PR when the remote was removed)
Using the current beta version 4.0.13 (and .12 beta), I tried to solve it by pulling directly, but there is an error that affects the calculation of the current version when used directly ( https://github.com/GitTools/GitVersion/issues / 1390 )
My current workaround is to remove the front pool before:
def remotes = bat(script: "@call git remote show", returnStdout: true).trim().readLines() def hasUpstream = remotes.any { it == "upstream" } def upstreamURL if (hasUpstream) { echo "Remote 'upstream' detected -- ${env.BRANCH_NAME} is pull request, removing remote for further processing" upstreamURL = bat(script: "@call git remote get-url upstream", returnStdout: true).trim() bat "git remote remove upstream" }
then do:
def command = "@call ${BuildInfo.GitVersion.Run} /updateassemblyinfo /ensureassemblyinfo /nofetch /verbosity debug" def output = bat(script: command, returnStdout: true).trim()
and add it back:
if (hasUpstream) { echo "Restoring 'upstream' remote using url: ${upstreamURL}" bat "git remote add -t master --tags upstream ${upstreamURL}" }
source share