diff --git a/proxy/azure-pipelines.yml b/proxy/azure-pipelines.yml index 0144f6dd5..8dc3c63a9 100644 --- a/proxy/azure-pipelines.yml +++ b/proxy/azure-pipelines.yml @@ -1,6 +1,12 @@ trigger: - master +variables: + ${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}: + branchName: ${{ replace(variables['Build.SourceBranchName'], 'refs/heads/', '') }} + ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}: + branchName: ${{ replace(variables['System.PullRequest.SourceBranch'], 'refs/heads/', '') }} + stages: - stage: generate jobs: @@ -87,4 +93,4 @@ stages: command: 'buildAndPush' Dockerfile: 'proxy/Dockerfile' buildContext: 'proxy/' - tags: 'gh-$(Build.SourceBranchName)' + tags: "gh-${{ variables.branchName }}" diff --git a/web/azure-pipelines.yml b/web/azure-pipelines.yml index 83ed61fec..d2e61c6cf 100644 --- a/web/azure-pipelines.yml +++ b/web/azure-pipelines.yml @@ -1,6 +1,12 @@ trigger: - master +variables: + ${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}: + branchName: ${{ replace(variables['Build.SourceBranchName'], 'refs/heads/', '') }} + ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}: + branchName: ${{ replace(variables['System.PullRequest.SourceBranch'], 'refs/heads/', '') }} + stages: - stage: lint jobs: