You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched issues to ensure it has not already been reported
GitVersion package
AzureDevops task
GitVersion version
5
Operating system
N/A
What are you seeing?
Hi everyone. I have two repositories in Azure Devops: first with pipelines YAML code and second with Nuget packages code and Girversion config file.
I have such pipeline code
parameters:
- name: branchName
displayName: Branch name for repository to use code from for manual launch (feature/* - for features, hotfix/* - for hotfixes, release/* - for releases, main - for main branch, dev - for dev branch)
type: string
default: dev
resources:
repositories:
- repository: nuget_repository
type: git
name: NugetProject/NugetRepo
ref: ${{ parameters.branchName }}
trigger:
branches:
include:
- main
- dev
- release/*
trigger: none
pool:
vmImage: ubuntu-latest
stages:
- stage: TestAndBuild
displayName: 'Build, test and publish packages'
jobs:
- job: CreatePackages
displayName: Build, test and publish packages
workspace:
clean: all
steps:
- checkout: nuget_repository
fetchDepth: 0
- task: gitversion/setup@1
inputs:
versionSpec: '5.x'
- task: gitversion/execute@1
displayName: Determine Version
inputs:
useConfigFile: true
configFilePath: ./GitVersion.yml
- script: echo current version is $(GitVersion.SemVer)
displayName: 'Display calculated version'
- task: Bash@3
inputs:
targetType: 'inline'
script: echo "##vso[task.setvariable variable=version]$(GitVersion.SemVer)"
displayName: 'Update build number'
- task: DotNetCoreCLI@2
displayName: Restore packages
inputs:
command: 'restore'
projects: '**/*.csproj'
feedsToUse: 'select'
vstsFeed: 'NugetFeed'
- task: DotNetCoreCLI@2
displayName: Build project
inputs:
command: 'build'
projects: '**/*.csproj'
- task: DotNetCoreCLI@2
displayName: Run tests
inputs:
command: 'test'
projects: '**/*[Te]ests/*.csproj'
arguments: '--configuration Release --collect "XPlat Code coverage" -- RunConfiguration.DisableAppDomain=true'
testRunTitle: PortalTestsRun
- script: 'dotnet tool update --global dotnet-reportgenerator-globaltool'
displayName: 'Install or update ReportGenerator'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"'
displayName: 'Generate Code Coverage report'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
- task: PublishCodeCoverageResults@1
displayName: 'Publish Code Coverage report'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
- task: NuGetCommand@2
displayName: Pack projects into packages
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
command: 'pack'
packagesToPack: 'NugetRepo/src/**/*.csproj'
versioningScheme: byEnvVar
versionEnvVar: GitVersion.SemVer
- task: NuGetCommand@2
displayName: Push packages to feed
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: 'FeedId'
During pipeline execution gitversion/execute@1 task reads Gitversion config file from NugetRepo, but instead of using branch names from that NugetRepo, it uses branch name form repo with pipelines YAML code.
What is expected?
I'm running pipeline from dev branch of infrastructure repo using feature/123 branch of Nuget packages repo.
I'm expecting to have package with 1.0.0-feature/123 version, but instead I'm having 1.0.0-dev
Steps to Reproduce
Create repo with pipeline.
Create repo with packages.
Run pipeline.
RepositoryFixture Test
No response
Output log or link to your CI build (if appropriate).
No response
The text was updated successfully, but these errors were encountered:
Prerequisites
GitVersion package
AzureDevops task
GitVersion version
5
Operating system
N/A
What are you seeing?
Hi everyone. I have two repositories in Azure Devops: first with pipelines YAML code and second with Nuget packages code and Girversion config file.
I have such pipeline code
During pipeline execution gitversion/execute@1 task reads Gitversion config file from NugetRepo, but instead of using branch names from that NugetRepo, it uses branch name form repo with pipelines YAML code.
What is expected?
I'm running pipeline from dev branch of infrastructure repo using feature/123 branch of Nuget packages repo.
I'm expecting to have package with 1.0.0-feature/123 version, but instead I'm having 1.0.0-dev
Steps to Reproduce
Create repo with pipeline.
Create repo with packages.
Run pipeline.
RepositoryFixture Test
No response
Output log or link to your CI build (if appropriate).
No response
The text was updated successfully, but these errors were encountered: