diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 42de8d92d..de4aafc93 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -44,11 +44,27 @@ stages: - template: update-maven-version-steps.yml parameters: mavenSettingsFilePath: $(mavenSettings.secureFilePath) + - task: PythonScript@0 + name: fixBranchName + displayName: 'Compute short branch name for buildInfo' + inputs: + scriptSource: 'inline' + script: | + branch = "$(Build.SourceBranch)" + refPrefix = "refs/heads/" + if branch.startswith(refPrefix): + fixedBranch = branch[len(refPrefix):] + else: + fixedBranch = branch + # Workaround for https://github.com/Microsoft/azure-pipelines-agent/issues/838 + print("##vso[task.setvariable variable=fixedBranch;isOutput=true]" + fixedBranch) - task: Maven@3 displayName: 'Run Maven deploy' env: ARTIFACTORY_DEPLOY_USERNAME: $(ARTIFACTORY_DEPLOY_USERNAME) ARTIFACTORY_DEPLOY_PASSWORD: $(ARTIFACTORY_DEPLOY_PASSWORD) + GIT_SHA1: $(Build.SourceVersion) + GITHUB_BRANCH: $(fixBranchName.fixedBranch) inputs: goals: 'deploy' options: >-