GitHub Actions that allow the setup and use of the GitVersion and GitReleaseManager tools.
Examples for usage of GitVersion:
Examples for usage of GitReleaseManager:
GitHub Action that installs and uses the GitVersion and GitReleaseManager tools
License: MIT License
GitHub Actions that allow the setup and use of the GitVersion and GitReleaseManager tools.
Examples for usage of GitVersion:
Examples for usage of GitReleaseManager:
Hi,
In Azure Devops we were using the GitVersion task in the following way:
parameters:
toolVersion: '5.3.7'
steps:
- task: gitversion/setup@0
displayName: Download GitVersion
inputs:
versionSpec: ${{ parameters.toolVersion }}
- task: gitversion/execute@0
inputs:
additionalArguments: '-output file'
displayName: Execute GitVersion
This was working until Friday evening when an update to the task was pushed to the org at which point all builds are now failing. I have tried updating to 5.5.0 with no luck and changing the argument to use the / switch instead of - to be in line with all other switches being pushed. Here is an output of the failing task now.
Starting: Execute GitVersion
==============================================================================
Task : Execute GitVersion Task
Description : Easy Semantic Versioning (http://semver.org) for projects using Git
Version : 0.9.5
Author : GitTools Contributors
Help : See the [documentation](https://gitversion.net/docs/) for help
==============================================================================
Command: dotnet-gitversion /home/vsts/work/1/s /output json /output buildserver -output file
/opt/hostedtoolcache/GitVersion.Tool/5.3.7/x64/dotnet-gitversion /home/vsts/work/1/s /output json /output buildserver -output file
Unhandled exception. GitVersion.WarningException: Could not parse command line parameter '-output file'.
at GitVersion.ArgumentParser.ParseTargetPath(Arguments arguments, String name, String[] values, String value, Boolean parseEnded) in D:\a\GitVersion\GitVersion\src\GitVersionExe\ArgumentParser.cs:line 194
at GitVersion.ArgumentParser.ParseSwitchArguments(Arguments arguments, NameValueCollection switchesAndValues, Int32 i) in D:\a\GitVersion\GitVersion\src\GitVersionExe\ArgumentParser.cs:line 126
at GitVersion.ArgumentParser.ParseArguments(String[] commandLineArguments) in D:\a\GitVersion\GitVersion\src\GitVersionExe\ArgumentParser.cs:line 88
at GitVersion.Program.<>c__DisplayClass4_0.<CreateHostBuilder>b__2(IServiceProvider sp) in D:\a\GitVersion\GitVersion\src\GitVersionExe\Program.cs:line 43
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
at GitVersion.GitVersionCoreModule.<>c.<RegisterTypes>b__0_0(IServiceProvider sp) in D:\a\GitVersion\GitVersion\src\GitVersionCore\GitVersionCoreModule.cs:line 55
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at GitVersion.Program.Main(String[] args) in D:\a\GitVersion\GitVersion\src\GitVersionExe\Program.cs:line 22
at GitVersion.Program.<Main>(String[] args)
GitHub are removing the support for set-env from 16th November due to a security issue. The current version of 0.9.6 still uses this function to set the GitVersion environment variables.
Command: dotnet-gitversion /home/runner/work/ModelBuilder/ModelBuilder /output json /output buildserver /config ./GitVersion.yml
/opt/hostedtoolcache/GitVersion.Tool/5.3.7/x64/dotnet-gitversion /home/runner/work/ModelBuilder/ModelBuilder /output json /output buildserver /config ./GitVersion.yml
INFO [11/15/20 5:00:11:35] Working directory: /home/runner/work/ModelBuilder/ModelBuilder
INFO [11/15/20 5:00:11:38] Branch from build environment: refs/heads/features/net5
INFO [11/15/20 5:00:11:38] Project root is: /home/runner/work/ModelBuilder/ModelBuilder/
INFO [11/15/20 5:00:11:38] DotGit directory is: /home/runner/work/ModelBuilder/ModelBuilder/.git
INFO [11/15/20 5:00:11:38] Begin: Normalizing git directory for branch 'refs/heads/features/net5'
INFO [11/15/20 5:00:11:41] One remote found (origin -> 'https://github.com/roryprimrose/ModelBuilder').
INFO [11/15/20 5:00:11:42] Skipping fetching, if GitVersion does not calculate your version as expected you might need to allow fetching or use dynamic repositories
INFO [11/15/20 5:00:11:42] Updating local branch refs/heads/features/net5 to point at d0ce7c4296cfaef966635219110850575f144563
INFO [11/15/20 5:00:11:45] Creating local branch from remote tracking 'refs/remotes/origin/master'.
INFO [11/15/20 5:00:11:46] HEAD points at branch 'refs/heads/features/net5'.
INFO [11/15/20 5:00:11:46] End: Normalizing git directory for branch 'refs/heads/features/net5' (Took: 86.10ms)
INFO [11/15/20 5:00:11:48] Begin: Loading version variables from disk cache
INFO [11/15/20 5:00:11:48] Cache file /home/runner/work/ModelBuilder/ModelBuilder/.git/gitversion_cache/1E674AD7E791FD2B4CC0841D5D24B7FE50380EFD.yml not found.
INFO [11/15/20 5:00:11:48] End: Loading version variables from disk cache (Took: 0.96ms)
INFO [11/15/20 5:00:11:57] Using latest commit on specified branch
INFO [11/15/20 5:00:11:59] Begin: Attempting to inherit branch configuration from parent branch
INFO [11/15/20 5:00:11:59] Begin: Finding branch source of 'features/net5'
INFO [11/15/20 5:00:11:60] Begin: Finding merge base between 'features/net5' and 'master'.
INFO [11/15/20 5:00:11:61] Found merge base of 06c18270ec4b473b75dbb9fcab6225f3bbd38c7c
INFO [11/15/20 5:00:11:62] Merge base of features/net5' and 'master is 06c18270ec4b473b75dbb9fcab6225f3bbd38c7c
INFO [11/15/20 5:00:11:62] End: Finding merge base between 'features/net5' and 'master'. (Took: 12.47ms)
INFO [11/15/20 5:00:11:62] End: Finding branch source of 'features/net5' (Took: 32.36ms)
INFO [11/15/20 5:00:11:63] Begin: Getting branches containing the commit '06c18270ec4b473b75dbb9fcab6225f3bbd38c7c'.
INFO [11/15/20 5:00:11:63] Trying to find direct branches.
INFO [11/15/20 5:00:11:63] No direct branches found, searching through all branches.
INFO [11/15/20 5:00:11:63] Searching for commits reachable from 'master'.
INFO [11/15/20 5:00:11:63] The branch 'master' has a matching commit.
INFO [11/15/20 5:00:11:63] Searching for commits reachable from 'origin/master'.
INFO [11/15/20 5:00:11:63] The branch 'origin/master' has a matching commit.
INFO [11/15/20 5:00:11:63] End: Getting branches containing the commit '06c18270ec4b473b75dbb9fcab6225f3bbd38c7c'. (Took: 3.55ms)
INFO [11/15/20 5:00:11:63] Begin: Getting branches containing the commit 'd0ce7c4296cfaef966635219110850575f144563'.
INFO [11/15/20 5:00:11:63] Trying to find direct branches.
INFO [11/15/20 5:00:11:63] No direct branches found, searching through all branches.
INFO [11/15/20 5:00:11:63] Searching for commits reachable from 'master'.
INFO [11/15/20 5:00:11:63] The branch 'master' has no matching commits.
INFO [11/15/20 5:00:11:63] Searching for commits reachable from 'origin/master'.
INFO [11/15/20 5:00:11:64] The branch 'origin/master' has no matching commits.
INFO [11/15/20 5:00:11:64] End: Getting branches containing the commit 'd0ce7c4296cfaef966635219110850575f144563'. (Took: 3.63ms)
INFO [11/15/20 5:00:11:64] Found possible parent branches: master, origin/master
WARN [11/15/20 5:00:11:64] Failed to inherit Increment branch configuration, ended up with: master, origin/master
Error: The `set-env` command is deprecated and will be disabled on November 16th. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
Error: The `set-env` command is deprecated and will be disabled on November 16th. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
Error: The `set-env` command is deprecated and will be disabled on November 16th. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
Error: The `set-env` command is deprecated and will be disabled on November 16th. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
Error: The `set-env` command is deprecated and will be disabled on November 16th. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
Error: The `set-env` command is deprecated and will be disabled on November 16th. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
{
"Major":7,
"Minor":1,
"Patch":1,
"PreReleaseTag":"net5.2",
"PreReleaseTagWithDash":"-net5.2",
"PreReleaseLabel":"net5",
"PreReleaseNumber":2,
"WeightedPreReleaseNumber":30002,
"BuildMetaData":"",
"BuildMetaDataPadded":"",
"FullBuildMetaData":"Branch.features-net5.Sha.d0ce7c4296cfaef966635219110850575f144563",
"MajorMinorPatch":"7.1.1",
"SemVer":"7.1.1-net5.2",
"LegacySemVer":"7.1.1-net5-2",
"LegacySemVerPadded":"7.1.1-net5-0002",
"AssemblySemVer":"7.1.1.0",
"AssemblySemFileVer":"7.1.1.0",
"FullSemVer":"7.1.1-net5.2",
"InformationalVersion":"7.1.1-net5.2+Branch.features-net5.Sha.d0ce7c4296cfaef966635219110850575f144563",
"BranchName":"features/net5",
"EscapedBranchName":"features-net5",
"Sha":"d0ce7c4296cfaef966635219110850575f144563",
"ShortSha":"d0ce7c4",
"NuGetVersionV2":"7.1.1-net5-0002",
"NuGetVersion":"7.1.1-net5-0002",
"NuGetPreReleaseTagV2":"net5-0002",
"NuGetPreReleaseTag":"net5-0002",
"VersionSourceSha":"06c18270ec4b473b75dbb9fcab6225f3bbd38c7c",
"CommitsSinceVersionSource":2,
"CommitsSinceVersionSourcePadded":"0002",
"CommitDate":"2020-11-15"
}
INFO [11/15/20 5:00:11:87] Done writing
GitHub Actions workflow contains:
- name: Install GitVersion
uses: gittools/[email protected]
with:
versionSpec: '5.1.x'
includePrerelease: false
Output:
Run gittools/[email protected]
##[error]File not found: 'd:\a\_actions\gittools\actions\v0.9.1\dist/github/setup/index.js'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # Number of commits to fetch. 0 indicates all history for all branches and tags. Default: 1
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Setup GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'`
Hello ๐
Is this GitHub action ready for use and if so how do we use it or does it require extra arguments in the actions.yml file.
A readme on the repo homepage would be useful to have please :)
I have suddenly started to get this error (even with the latest version)
Error: Unable to process command '::set-env name=GitVersion_CommitDate::2020-11-23' successfully.
Error: The set-env
command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the ACTIONS_ALLOW_UNSECURE_COMMANDS
environment variable to true
. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
it is related to a security issue which has been patched by GitHub and I understand needs to be addressed by GitTools
Describe the bug
Using the ExecuteGitVersion Azure DevOps Task with multiple additional arguments causes a exception. The multiple arguments are passed as a string in the arguments and cannot be parsed.
Using the Task with one argument works fine.
##[section]Starting: Execute GitVersion
==============================================================================
Task : Execute GitVersion Task
Description : Easy Semantic Versioning (http://semver.org) for projects using Git
Version : 0.9.3
Author : GitTools Contributors
Help : See the [documentation](https://gitversion.net/docs/) for help
==============================================================================
Command: dotnet-gitversion d:/a/1/s /output json /output buildserver /updateprojectfiles /verbosity Diagnostic
[command]C:\hostedtoolcache\windows\GitVersion.Tool\5.3.5\x64\dotnet-gitversion.exe d:/a/1/s /output json /output buildserver "/updateprojectfiles /verbosity Diagnostic"
Unhandled exception. GitVersion.WarningException: Could not parse command line parameter '/updateprojectfiles /verbosity Diagnostic'.
at GitVersion.ArgumentParser.ParseTargetPath(Arguments arguments, String name, String[] values, String value, Boolean parseEnded) in D:\a\GitVersion\GitVersion\src\GitVersionExe\ArgumentParser.cs:line 194
at GitVersion.ArgumentParser.ParseSwitchArguments(Arguments arguments, NameValueCollection switchesAndValues, Int32 i) in D:\a\GitVersion\GitVersion\src\GitVersionExe\ArgumentParser.cs:line 126
at GitVersion.ArgumentParser.ParseArguments(String[] commandLineArguments) in D:\a\GitVersion\GitVersion\src\GitVersionExe\ArgumentParser.cs:line 88
at GitVersion.Program.<>c__DisplayClass4_0.<CreateHostBuilder>b__2(IServiceProvider sp) in D:\a\GitVersion\GitVersion\src\GitVersionExe\Program.cs:line 43
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
at GitVersion.GitVersionCoreModule.<>c.<RegisterTypes>b__0_0(IServiceProvider sp) in D:\a\GitVersion\GitVersion\src\GitVersionCore\GitVersionCoreModule.cs:line 55
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at GitVersion.Program.Main(String[] args) in D:\a\GitVersion\GitVersion\src\GitVersionExe\Program.cs:line 22
at GitVersion.Program.<Main>(String[] args)
##[error]SyntaxError: Unexpected end of JSON input
##[section]Finishing: Execute GitVersion
azure-pipelines.yml
trigger:
- '*'
jobs:
- job: 'Build'
displayName: 'Build'
pool:
vmImage: 'windows-latest'
steps:
- task: gitversion/setup@0
displayName: 'Setup GitVersion'
inputs:
versionSpec: '5.3.5'
- task: gitversion/execute@0
displayName: 'Execute GitVersion'
inputs:
additionalArguments: '/updateprojectfiles /verbosity Diagnostic'
On our project we use dotnet core 3.1, but when running gitversion in our pipeline it fails since it wants 2.1
azurepipeline.yaml
steps:
- task: DotNetCoreInstaller@0
displayName: 'Install .NET Core sdk 3.1.100'
inputs:
version: 3.1.100
- task: gittools.gittools.setup-gitversion-task.gitversion/setup@0
displayName: gitversion/setup
inputs:
versionSpec: 5.1.x
- task: gittools.gittools.execute-gitversion-task.gitversion/execute@0
displayName: gitversion/execute
inputs:
useConfigFile: true
configFilePath: GitVersion.yml
Output:
Command: dotnet-gitversion /workspace/2/s /output json /config /workspace/2/s/GitVersion.yml
[command]/workspace/_tool/GitVersion.Tool/5.1.3/x64/dotnet-gitversion /workspace/2/s /output json /config /workspace/2/s/GitVersion.yml undefined
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '2.1.0' was not found.
- The following frameworks were found:
3.1.0 at [/workspace/_tool/dncs/3.1.100/x64/shared/Microsoft.NETCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
The specified framework can be found at:
- https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.1.0&arch=x64&rid=ubuntu.18.04-x64
##[error]SyntaxError: Unexpected end of JSON input
Workaround is to install 2.1 as well, but I'd rather not do that :)
I found that the directions as documented don't work for private repositories.
When one creates an action in a private repository following the instructions, they'll find that the action fails or hangs when it tries to run 'git fetch --tags'. With an ubuntu action the error reads: 'fatal: could not read Username for 'https://github.com': No such device or address'. With a windows action the action hangs after it opens credential manager.
It appears that the actions/checkout action resets git configuration after checkout so the credentials aren't available to the 'git fetch --tags' and 'git branch --create-reflog master origin/master' commands. https://github.com/actions/checkout/blob/5881116d181dc80f3ed5f395296a5579ee6fc6a4/src/git-source-provider.ts#L146
I recommend adding another line to the 'Fetch tags and master for GitVersion' step in the documentation to add credentials for private repositories. The following command is working well for me:
git config remote.origin.url https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Fetch tags and master for GitVersion
run: |
git config remote.origin.url https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} # creds needed for private repos
git fetch --tags
git branch --create-reflog master origin/master
I noticed that when trying to access escapedBranchName
added in GitTools/GitVersion#2157 as steps.gitversion.outputs.escapedBranchName
, it just came out empty even though ยดEscapedBranchName` was written to the console as the default JSON output.
Unless I'm mistaken, it seems like the version variables coming from GitVersion are not passed invisibly through gittools/actions/gitversion/execute
, but instead explicitly mapped. This reduces the value of versionSpec
in gittools/actions/gitversion/setup
since it's not possible to upgrade to a newer version of GitVersion and have its version variables available without also upgrading gittools/actions/gitversion/execute
.
I had hoped that providing the additional argument /ensureassemblyinfo that GitVersion would work, but sadly it seems that the action is hardchecking the file provided in the updateAssemblyInfoFilename, effectively rendering the additional argument useless.
Would it be possible to add support for /ensureassemblyinfo without me requiring to run a custom step to create the file first?
I just got the following exception while running gittools/actions/gitversion/[email protected]
:
(node:2814) UnhandledPromiseRejectionWarning: TypeError: (e || "").replace is not a function
Any idea what might cause this?
Here is my setup:
- task: gitversion/setup@0
inputs:
versionSpec: '5.x'
- task: gitversion/execute@0
inputs:
useConfigFile: true
configFilePath: 'GitVersion.yml'
additionalArguments: ''
This is the command line in the Azure DevOps log.
/opt/hostedtoolcache/GitVersion.Tool/5.2.0/x64/dotnet-gitversion /home/vsts/work/1/s /output json /config /home/vsts/work/1/s/GitVersion.yml undefined
And I got an error
According to: libgit2/libgit2sharp#1703, running GitVersion in the Hosted Agents of Microsoft in Azure DevOps (we have our own agents, but use https://github.com/actions/virtual-environments/tree/main/images/linux which is the same base) gives me the same error.
Since it's scripted and the Hosted Agents doesn't come with GitTools pre-installed, I cannot use GitVersion on Linux, whereas on Windows it works.
Any advice?
Dear all, I had an issue with that task. Everything was working as expected few days ago but today I am facing a new issue on my github action.
"InformationalVersion":"0.2.0-contact.1+11.Branch.feature-contact.Sha.4020174ba02f00f22476726e1d8df5f0e9010d6b", "BranchName":"feature/contact", "EscapedBranchName":"feature-contact", "Sha":"4020174ba02f00f22476726e1d8df5f0e9010d6b", "ShortSha":4020174, "NuGetVersionV2":"0.2.0-contact0001", "NuGetVersion":"0.2.0-contact0001", "NuGetPreReleaseTagV2":"contact0001", "NuGetPreReleaseTag":"contact0001", "VersionSourceSha":"182f445bd92ecd014dfe3f832d61a5bea9e4361e", "CommitsSinceVersionSource":11, "CommitsSinceVersionSourcePadded":"0011", "CommitDate":"2020-05-06" } (node:2681) UnhandledPromiseRejectionWarning: TypeError: (e || "").replace is not a function at /home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:5:943 at s.toString (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:5:1005) at o (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:5:372) at Object.t.issue (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:5:432) at c (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:9:741) at Object.t.setFailed (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:9:1482) at h.setFailed (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:308:1902) at Object.<anonymous> (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:336:1575) at Generator.next (<anonymous>) at s (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:336:170) (node:2681) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:2681) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Here is my configuration file for the pipeline
steps: - uses: actions/checkout@v2 - name: Fetch all history for all tags and branches run: | git config remote.origin.url https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} git fetch --prune --unshallow - name: Install GitVersion uses: gittools/actions/gitversion/[email protected] with: versionSpec: "5.2.x" - name: Use GitVersion id: gitversion # step id used as reference for output values uses: gittools/actions/gitversion/[email protected]
did you have any idea on that ? Tanks a lot in advance...
When I run the following azure pipeline, I don't get any errors:
- task: gittools.gittools.execute-gitversion-task.gitversion/execute@0
displayName: gitversion/execute
When I specify the inputs to specify the gitversion.yaml file like this:
- task: gittools.gittools.execute-gitversion-task.gitversion/execute@0
displayName: gitversion/execute
inputs:
useConfigFile: true
configFilePath: GitVersion.yml
I get the following exception, somehow the value undefined
or null
is appended to the command:
Command: dotnet-gitversion /workspace/1/s /output json /config /workspace/1/s/GitVersion.yml
##[debug]which 'dotnet-gitversion'
##[debug]found: '/workspace/_tool/GitVersion.Tool/5.1.3/x64/dotnet-gitversion'
##[debug]/workspace/_tool/GitVersion.Tool/5.1.3/x64/dotnet-gitversion arg: ["/workspace/1/s","/output","json","/config","/workspace/1/s/GitVersion.yml",null]
##[debug]exec tool: /workspace/_tool/GitVersion.Tool/5.1.3/x64/dotnet-gitversion
##[debug]arguments:
##[debug] /workspace/1/s
##[debug] /output
##[debug] json
##[debug] /config
##[debug] /workspace/1/s/GitVersion.yml
##[debug] undefined
[command]/workspace/_tool/GitVersion.Tool/5.1.3/x64/dotnet-gitversion /workspace/1/s /output json /config /workspace/1/s/GitVersion.yml undefined
Unhandled exception. GitVersion.Exceptions.WarningException: Could not parse command line parameter 'undefined'.
at GitVersion.ArgumentParser.EnsureArgumentValueCount(String[] values, Int32 maxArguments) in D:\a\1\s\src\GitVersionExe\ArgumentParser.cs:line 434
at GitVersion.ArgumentParser.ParseArguments(String[] commandLineArguments) in D:\a\1\s\src\GitVersionExe\ArgumentParser.cs:line 91
at GitVersion.Program.<>c__DisplayClass1_0.<CreateHostBuilder>b__2(IServiceProvider sp) in D:\a\1\s\src\GitVersionExe\Program.cs:line 28
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
at GitVersion.GitVersionCoreModule.<>c.<RegisterTypes>b__0_0(IServiceProvider sp) in D:\a\1\s\src\GitVersionCore\GitVersionCoreModule.cs:line 38
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
##[debug]task result: Failed
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
##[error]SyntaxError: Unexpected end of JSON input
##[debug]Processed: ##vso[task.issue type=error;]SyntaxError: Unexpected end of JSON input
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at GitVersion.Program.Main(String[] args) in D:\a\1\s\src\GitVersionExe\Program.cs:line 14
at GitVersion.Program.<Main>(String[] args)
##[debug]Processed: ##vso[task.complete result=Failed;done=true;]SyntaxError: Unexpected end of JSON input
Another related question: Should I specify the /output buildserver
myself?
I have the following in my github actions which is copied from the documentation in the readme (with config added).
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.2.x'
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
configFilePath: ./GitVersion.yml
Running the fetch step gives the following in the logs.
Run git fetch --prune --unshallow
git fetch --prune --unshallow
shell: /bin/bash -e {0}
env:
projectName: ModelBuilder
This isn't downloading the tags as expected and therefore generating an incorrect version.
I have updated the step to explicitly include tags.
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow --tags
The build now fetches the following tags and generates the correct version.
Run git fetch --prune --unshallow --tags
git fetch --prune --unshallow --tags
shell: /bin/bash -e {0}
env:
projectName: ModelBuilder
From https://github.com/roryprimrose/ModelBuilder
* [new branch] master -> origin/master
* [new tag] 4.0.0-beta0049 -> 4.0.0-beta0049
* [new tag] 4.0.0-beta0050 -> 4.0.0-beta0050
* [new tag] 4.0.0-beta0051 -> 4.0.0-beta0051
* [new tag] 4.0.0-beta0052 -> 4.0.0-beta0052
* [new tag] 4.0.0-beta0053 -> 4.0.0-beta0053
* [new tag] 4.0.0-beta0054 -> 4.0.0-beta0054
* [new tag] 4.0.0-beta0057 -> 4.0.0-beta0057
* [new tag] 4.0.0-beta0059 -> 4.0.0-beta0059
* [new tag] 6.0.0 -> 6.0.0
* [new tag] 6.0.0-beta0001 -> 6.0.0-beta0001
* [new tag] 6.0.0-beta0002 -> 6.0.0-beta0002
* [new tag] 6.0.0-beta0003 -> 6.0.0-beta0003
* [new tag] 6.0.0-beta0004 -> 6.0.0-beta0004
* [new tag] 6.0.0-beta0005 -> 6.0.0-beta0005
* [new tag] 6.0.0-beta0006 -> 6.0.0-beta0006
* [new tag] 6.0.0-beta0007 -> 6.0.0-beta0007
* [new tag] 6.0.0-beta0008 -> 6.0.0-beta0008
* [new tag] 6.0.0-beta0009 -> 6.0.0-beta0009
* [new tag] 6.0.0-beta0010 -> 6.0.0-beta0010
* [new tag] 6.0.0-beta0011 -> 6.0.0-beta0011
[truncated]
The documentation on unshallow isn't clear about what it does with tags but it does not seem to fetch them.
running on azure devops on prem:
##[debug]agent.TempDirectory=D:\vsts-agent_work_temp
##[debug]loading inputs and endpoints
##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
##[debug]loading INPUT_CONFIGFILEPATH
##[debug]loading INPUT_UPDATEASSEMBLYINFO
##[debug]loading INPUT_USECONFIGFILE
##[debug]loading SECRET_AGENT_PROXYPASSWORD
##[debug]loaded 7
##[debug]Agent.ProxyUrl=http://x.x.x.x:8080
##[debug]Agent.ProxyUsername=dddxxx
##[debug]Agent.ProxyPassword=***
##[debug]Agent.ProxyBypassList=["tfs\.t-fs01\.vwfs-ad","tfs2010-test\.t-fs01\.vwfs-ad","10\.((1?\d?\d|25[0-5]|2[0-4]\d)(\.|$)){3}",".\.local",".\.external",".\.vwf\.vwfs-ad",".\.d-fs01\.d-vwf\.d-vwfs-ad",".\.t-fs01\.vwfs-ad"]
##[debug]Agent.TempDirectory=D:\vsts-agent_work_temp
##[debug]expose agent proxy configuration.
##[debug]Agent.CAInfo=undefined
##[debug]Agent.ClientCert=undefined
##[debug]Agent.SkipCertValidation=undefined
##[debug]Agent.ProxyUrl=http://x.x.x.x:8080
##[debug]Agent.ProxyUsername=dddxxx
##[debug]Agent.ProxyPassword=**
##[debug]Agent.ProxyBypassList=["tfs\.t-fs01\.vwfs-ad","tfs2010-test\.t-fs01\.vwfs-ad","10\.((1?\d?\d|25[0-5]|2[0-4]\d)(\.|$)){3}",".\.local",".\.external",".\.vwf\.vwfs-ad",".\.d-fs01\.d-vwf\.d-vwfs-ad",".\.t-fs01\.vwfs-ad"]
##[debug]Agent.CAInfo=undefined
##[debug]Agent.ClientCert=undefined
##[debug]check path : D:\vsts-agent_work_tasks\gitversion\execute_9013cf7f-ee8d-49f4-a39b-db244928d391\0.9.3\lib.json
##[debug]adding resource file: D:\vsts-agent_work_tasks\gitversion\execute_9013cf7f-ee8d-49f4-a39b-db244928d391\0.9.3\lib.json
##[debug]system.culture=en-US
##[debug]Agent.ProxyUrl=http://x.x.x.x:8080
##[debug]Agent.ProxyUsername=dddxxx
##[debug]Agent.ProxyPassword=**
##[debug]Agent.ProxyBypassList=["tfs\.t-fs01\.vwfs-ad","tfs2010-test\.t-fs01\.vwfs-ad","10\.((1?\d?\d|25[0-5]|2[0-4]\d)(\.|$)){3}",".\.local",".\.external",".\.vwf\.vwfs-ad",".\.d-fs01\.d-vwf\.d-vwfs-ad",".\.t-fs01\.vwfs-ad"]
##[debug]Agent.CAInfo=undefined
##[debug]Agent.ClientCert=undefined
##[debug]Agent.SkipCertValidation=undefined
##[debug]task result: Failed
##[error]Unhandled: Invalid regular expression: /.local/: Nothing to repeat
##[debug]Processed: ##vso[task.issue type=error;]Unhandled: Invalid regular expression: /.local/: Nothing to repeat
##[debug]Processed: ##vso[task.complete result=Failed;]Unhandled: Invalid regular expression: /.local/: Nothing to repeat
##[section]Finishing: gitversion/execute
assuming that the task is failing on the ProxyBypassList,
Currently, only three of the GitVersion variables are supported. It would be nice if all of them would be accessible via ${{ steps.gitversion.outputs.VARIABLE }}"
when using the config;
- name: install gitversion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.2.x'
- name: setup gitversion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]
getting the error;
2020-03-26T11:58:13.2019138Z ##[group]Run gittools/actions/gitversion/[email protected]
2020-03-26T11:58:13.2019318Z with:
2020-03-26T11:58:13.2019453Z useConfigFile: false
2020-03-26T11:58:13.2019581Z updateAssemblyInfo: false
2020-03-26T11:58:13.2019710Z env:
2020-03-26T11:58:13.2019832Z DOTNET_CLI_TELEMETRY_OPTOUT: 1
2020-03-26T11:58:13.2019916Z DOTNET_ROOT: ../share/dotnet
2020-03-26T11:58:13.2020041Z ##[endgroup]
2020-03-26T11:58:13.2672424Z Command: dotnet-gitversion /home/runner/work/hypeengine/hypeengine /output json /output buildserver
2020-03-26T11:58:13.2745258Z [command]/opt/hostedtoolcache/GitVersion.Tool/5.2.4/x64/dotnet-gitversion /home/runner/work/hypeengine/hypeengine /output json /output buildserver
2020-03-26T11:58:13.5028053Z INFO [03/26/20 11:58:13:49] Working directory: /home/runner/work/hypeengine/hypeengine
2020-03-26T11:58:13.5187217Z INFO [03/26/20 11:58:13:51] Applicable build agent found: 'GitHubActions'.
2020-03-26T11:58:13.5200042Z INFO [03/26/20 11:58:13:51] Branch from build environment: refs/heads/feature/dotnetcore-3.1.200
2020-03-26T11:58:13.5200922Z INFO [03/26/20 11:58:13:51] Begin: Normalizing git directory for branch 'refs/heads/feature/dotnetcore-3.1.200'
2020-03-26T11:58:13.5504380Z INFO [03/26/20 11:58:13:54] One remote found (origin -> 'https://github.com/bonesoul/hypeengine').
2020-03-26T11:58:13.5530249Z INFO [03/26/20 11:58:13:55] Skipping fetching, if GitVersion does not calculate your version as expected you might need to allow fetching or use dynamic repositories
2020-03-26T11:58:13.5577501Z INFO [03/26/20 11:58:13:55] Updating local branch refs/heads/feature/dotnetcore-3.1.200 to point at 9810146ebdd84f7b57cb3784955d1610bd816a2f
2020-03-26T11:58:13.5826230Z INFO [03/26/20 11:58:13:58] Creating local branch from remote tracking 'refs/remotes/origin/develop'.
2020-03-26T11:58:13.5956450Z INFO [03/26/20 11:58:13:59] Creating local branch from remote tracking 'refs/remotes/origin/feature/data-processing'.
2020-03-26T11:58:13.5977709Z INFO [03/26/20 11:58:13:59] Creating local branch from remote tracking 'refs/remotes/origin/master'.
2020-03-26T11:58:13.5999463Z INFO [03/26/20 11:58:13:59] Creating local branch from remote tracking 'refs/remotes/origin/psn-task'.
2020-03-26T11:58:13.6008160Z INFO [03/26/20 11:58:13:60] HEAD points at branch 'refs/heads/feature/dotnetcore-3.1.200'.
2020-03-26T11:58:13.6019407Z INFO [03/26/20 11:58:13:60] End: Normalizing git directory for branch 'refs/heads/feature/dotnetcore-3.1.200' (Took: 81.41ms)
2020-03-26T11:58:13.6019655Z INFO [03/26/20 11:58:13:60] Project root is: /home/runner/work/hypeengine/hypeengine/
2020-03-26T11:58:13.6019919Z INFO [03/26/20 11:58:13:60] DotGit directory is: /home/runner/work/hypeengine/hypeengine/.git
2020-03-26T11:58:13.6155557Z INFO [03/26/20 11:58:13:61] Begin: Loading version variables from disk cache
2020-03-26T11:58:13.6164284Z INFO [03/26/20 11:58:13:61] Cache file /home/runner/work/hypeengine/hypeengine/.git/gitversion_cache/A1AA4C4E426E17E32D916FCD5B1BE9A61A22A18B.yml not found.
2020-03-26T11:58:13.6166138Z INFO [03/26/20 11:58:13:61] End: Loading version variables from disk cache (Took: 1.01ms)
2020-03-26T11:58:13.7040889Z INFO [03/26/20 11:58:13:70] Using latest commit on specified branch
2020-03-26T11:58:13.7229053Z INFO [03/26/20 11:58:13:72] Begin: Attempting to inherit branch configuration from parent branch
2020-03-26T11:58:13.7264116Z INFO [03/26/20 11:58:13:72] Begin: Finding branch source of 'feature/dotnetcore-3.1.200'
2020-03-26T11:58:13.7383866Z INFO [03/26/20 11:58:13:73] Begin: Finding merge base between 'feature/dotnetcore-3.1.200' and 'develop'.
2020-03-26T11:58:13.7443873Z INFO [03/26/20 11:58:13:74] Found merge base of ad66e185673835b552220007ba82f90466c1823a
2020-03-26T11:58:13.7510237Z INFO [03/26/20 11:58:13:75] Merge base of feature/dotnetcore-3.1.200' and 'develop is ad66e185673835b552220007ba82f90466c1823a
2020-03-26T11:58:13.7512886Z INFO [03/26/20 11:58:13:75] End: Finding merge base between 'feature/dotnetcore-3.1.200' and 'develop'. (Took: 12.56ms)
2020-03-26T11:58:13.7514332Z INFO [03/26/20 11:58:13:75] Begin: Finding merge base between 'feature/dotnetcore-3.1.200' and 'master'.
2020-03-26T11:58:13.7520292Z INFO [03/26/20 11:58:13:75] Found merge base of 1c75f9da771918547c4e854759f49da95aa4f855
2020-03-26T11:58:13.7522057Z INFO [03/26/20 11:58:13:75] Merge base of feature/dotnetcore-3.1.200' and 'master is 1c75f9da771918547c4e854759f49da95aa4f855
2020-03-26T11:58:13.7523060Z INFO [03/26/20 11:58:13:75] End: Finding merge base between 'feature/dotnetcore-3.1.200' and 'master'. (Took: 0.78ms)
2020-03-26T11:58:13.7611018Z INFO [03/26/20 11:58:13:76] Multiple source branches have been found, picking the first one (develop).
2020-03-26T11:58:13.7611642Z This may result in incorrect commit counting.
2020-03-26T11:58:13.7611935Z Options were:
2020-03-26T11:58:13.7612262Z develop, master
2020-03-26T11:58:13.7612984Z INFO [03/26/20 11:58:13:76] End: Finding branch source of 'feature/dotnetcore-3.1.200' (Took: 35.03ms)
2020-03-26T11:58:13.7652325Z INFO [03/26/20 11:58:13:76] Begin: Getting branches containing the commit 'ad66e185673835b552220007ba82f90466c1823a'.
2020-03-26T11:58:13.7652588Z INFO [03/26/20 11:58:13:76] Trying to find direct branches.
2020-03-26T11:58:13.7652773Z INFO [03/26/20 11:58:13:76] No direct branches found, searching through all branches.
2020-03-26T11:58:13.7653188Z INFO [03/26/20 11:58:13:76] Searching for commits reachable from 'develop'.
2020-03-26T11:58:13.7700005Z INFO [03/26/20 11:58:13:76] The branch 'develop' has a matching commit.
2020-03-26T11:58:13.7700917Z INFO [03/26/20 11:58:13:76] Searching for commits reachable from 'master'.
2020-03-26T11:58:13.7740691Z INFO [03/26/20 11:58:13:77] The branch 'master' has no matching commits.
2020-03-26T11:58:13.7741651Z INFO [03/26/20 11:58:13:77] Searching for commits reachable from 'origin/develop'.
2020-03-26T11:58:13.7803039Z INFO [03/26/20 11:58:13:77] The branch 'origin/develop' has a matching commit.
2020-03-26T11:58:13.7803999Z INFO [03/26/20 11:58:13:78] Searching for commits reachable from 'origin/master'.
2020-03-26T11:58:13.7889141Z INFO [03/26/20 11:58:13:78] The branch 'origin/master' has no matching commits.
2020-03-26T11:58:13.7889656Z INFO [03/26/20 11:58:13:78] End: Getting branches containing the commit 'ad66e185673835b552220007ba82f90466c1823a'. (Took: 21.66ms)
2020-03-26T11:58:13.7890074Z INFO [03/26/20 11:58:13:78] Begin: Getting branches containing the commit '9810146ebdd84f7b57cb3784955d1610bd816a2f'.
2020-03-26T11:58:13.7890275Z INFO [03/26/20 11:58:13:78] Trying to find direct branches.
2020-03-26T11:58:13.7890505Z INFO [03/26/20 11:58:13:78] No direct branches found, searching through all branches.
2020-03-26T11:58:13.7890896Z INFO [03/26/20 11:58:13:78] Searching for commits reachable from 'develop'.
2020-03-26T11:58:13.7968227Z INFO [03/26/20 11:58:13:79] The branch 'develop' has no matching commits.
2020-03-26T11:58:13.7968616Z INFO [03/26/20 11:58:13:79] Searching for commits reachable from 'master'.
2020-03-26T11:58:13.8038370Z INFO [03/26/20 11:58:13:80] The branch 'master' has no matching commits.
2020-03-26T11:58:13.8039076Z INFO [03/26/20 11:58:13:80] Searching for commits reachable from 'origin/develop'.
2020-03-26T11:58:13.8112100Z INFO [03/26/20 11:58:13:81] The branch 'origin/develop' has no matching commits.
2020-03-26T11:58:13.8112477Z INFO [03/26/20 11:58:13:81] Searching for commits reachable from 'origin/master'.
2020-03-26T11:58:13.8181324Z INFO [03/26/20 11:58:13:81] The branch 'origin/master' has no matching commits.
2020-03-26T11:58:13.8181892Z INFO [03/26/20 11:58:13:81] End: Getting branches containing the commit '9810146ebdd84f7b57cb3784955d1610bd816a2f'. (Took: 31.07ms)
2020-03-26T11:58:13.8186561Z INFO [03/26/20 11:58:13:81] Found possible parent branches: develop, origin/develop
2020-03-26T11:58:13.8197528Z WARN [03/26/20 11:58:13:81] Failed to inherit Increment branch configuration, ended up with: develop, origin/develop
2020-03-26T11:58:13.8198095Z Falling back to develop branch config
2020-03-26T11:58:13.8206805Z INFO [03/26/20 11:58:13:81] End: Attempting to inherit branch configuration from parent branch (Took: 97.30ms)
2020-03-26T11:58:13.8245689Z INFO [03/26/20 11:58:13:82] Running against branch: feature/dotnetcore-3.1.200 (9810146ebdd84f7b57cb3784955d1610bd816a2f)
2020-03-26T11:58:13.8263471Z INFO [03/26/20 11:58:13:82] Begin: Calculating base versions
2020-03-26T11:58:13.8394225Z INFO [03/26/20 11:58:13:83] Fallback base version: 0.1.0 with commit count source b898a968417ed4eb9edddcce6c9c75c0fa0fa665 (Incremented: None)
2020-03-26T11:58:13.9612773Z INFO [03/26/20 11:58:13:96] Git tag '0.5.1': 0.5.1 with commit count source 3713ebecda37dfd090ac4e8e3876209dde69ad51 (Incremented: 0.6.0)
2020-03-26T11:58:13.9613305Z INFO [03/26/20 11:58:13:96] Git tag '0.5.0': 0.5.0 with commit count source cb91626f07c674a790c089d857a3351a06f03b6a (Incremented: 0.6.0)
2020-03-26T11:58:13.9615977Z INFO [03/26/20 11:58:13:96] Git tag '0.4.3': 0.4.3 with commit count source 68922f4abe3011238e206e16b503e23236dd7b68 (Incremented: 0.5.0)
2020-03-26T11:58:13.9616692Z INFO [03/26/20 11:58:13:96] Git tag '0.4.2': 0.4.2 with commit count source fd803f150eeffe046bfd7ce57abf534127010160 (Incremented: 0.5.0)
2020-03-26T11:58:13.9620895Z INFO [03/26/20 11:58:13:96] Git tag '0.4.1': 0.4.1 with commit count source a67bef9a86cab61ed8b34ea14e6f76dde74eb34a (Incremented: 0.5.0)
2020-03-26T11:58:13.9722310Z INFO [03/26/20 11:58:13:97] Git tag '0.5.1': 0.5.1 with commit count source 3713ebecda37dfd090ac4e8e3876209dde69ad51 (Incremented: 0.6.0)
2020-03-26T11:58:13.9722757Z INFO [03/26/20 11:58:13:97] Git tag '0.5.0': 0.5.0 with commit count source cb91626f07c674a790c089d857a3351a06f03b6a (Incremented: 0.6.0)
2020-03-26T11:58:13.9726126Z INFO [03/26/20 11:58:13:97] Git tag '0.4.3': 0.4.3 with commit count source 68922f4abe3011238e206e16b503e23236dd7b68 (Incremented: 0.5.0)
2020-03-26T11:58:13.9730264Z INFO [03/26/20 11:58:13:97] Git tag '0.4.2': 0.4.2 with commit count source fd803f150eeffe046bfd7ce57abf534127010160 (Incremented: 0.5.0)
2020-03-26T11:58:13.9734478Z INFO [03/26/20 11:58:13:97] Git tag '0.4.1': 0.4.1 with commit count source a67bef9a86cab61ed8b34ea14e6f76dde74eb34a (Incremented: 0.5.0)
2020-03-26T11:58:13.9793521Z INFO [03/26/20 11:58:13:97] Found multiple base versions which will produce the same SemVer (0.6.0), taking oldest source for commit counting (Git tag '0.5.0')
2020-03-26T11:58:13.9794222Z INFO [03/26/20 11:58:13:97] Base version used: Git tag '0.5.0': 0.5.0 with commit count source cb91626f07c674a790c089d857a3351a06f03b6a (Incremented: 0.6.0)
2020-03-26T11:58:13.9794398Z INFO [03/26/20 11:58:13:97] End: Calculating base versions (Took: 153.07ms)
2020-03-26T11:58:13.9808214Z INFO [03/26/20 11:58:13:98] 95 commits found between cb91626f07c674a790c089d857a3351a06f03b6a and 9810146ebdd84f7b57cb3784955d1610bd816a2f
2020-03-26T11:58:13.9821694Z INFO [03/26/20 11:58:13:98] Using branch name to calculate version tag
2020-03-26T11:58:13.9829373Z INFO [03/26/20 11:58:13:98] Begin: Getting version tags from branch 'refs/heads/feature/dotnetcore-3.1.200'.
2020-03-26T11:58:13.9920885Z INFO [03/26/20 11:58:13:99] End: Getting version tags from branch 'refs/heads/feature/dotnetcore-3.1.200'. (Took: 9.09ms)
2020-03-26T11:58:13.9993854Z INFO [03/26/20 11:58:13:99] Begin: Creating dictionary
2020-03-26T11:58:14.0045684Z INFO [03/26/20 11:58:14:00] End: Creating dictionary (Took: 5.23ms)
2020-03-26T11:58:14.0079754Z INFO [03/26/20 11:58:14:00] Begin: Storing version variables to cache file /home/runner/work/hypeengine/hypeengine/.git/gitversion_cache/A1AA4C4E426E17E32D916FCD5B1BE9A61A22A18B.yml
2020-03-26T11:58:14.0531064Z INFO [03/26/20 11:58:14:05] End: Storing version variables to cache file /home/runner/work/hypeengine/hypeengine/.git/gitversion_cache/A1AA4C4E426E17E32D916FCD5B1BE9A61A22A18B.yml (Took: 44.81ms)
2020-03-26T11:58:14.0541551Z INFO [03/26/20 11:58:14:05] Running on Unix.
2020-03-26T11:58:14.0542348Z INFO [03/26/20 11:58:14:05] Applicable build agent found: 'GitHubActions'.
2020-03-26T11:58:14.0547368Z Executing GenerateSetVersionMessage for 'GitHubActions'.
2020-03-26T11:58:14.0547442Z
2020-03-26T11:58:14.0547735Z Executing GenerateBuildLogOutput for 'GitHubActions'.
2020-03-26T11:58:14.0573700Z {
2020-03-26T11:58:14.0573801Z "Major":0,
2020-03-26T11:58:14.0573933Z "Minor":6,
2020-03-26T11:58:14.0574105Z "Patch":0,
2020-03-26T11:58:14.0574616Z "PreReleaseTag":"dotnetcore-3-1-200.1",
2020-03-26T11:58:14.0574893Z "PreReleaseTagWithDash":"-dotnetcore-3-1-200.1",
2020-03-26T11:58:14.0575157Z "PreReleaseLabel":"dotnetcore-3-1-200",
2020-03-26T11:58:14.0575296Z "PreReleaseNumber":1,
2020-03-26T11:58:14.0575426Z "WeightedPreReleaseNumber":30001,
2020-03-26T11:58:14.0575579Z "BuildMetaData":95,
2020-03-26T11:58:14.0575710Z "BuildMetaDataPadded":"0095",
2020-03-26T11:58:14.0576017Z "FullBuildMetaData":"95.Branch.feature-dotnetcore-3.1.200.Sha.9810146ebdd84f7b57cb3784955d1610bd816a2f",
2020-03-26T11:58:14.0576219Z "MajorMinorPatch":"0.6.0",
2020-03-26T11:58:14.0576490Z "SemVer":"0.6.0-dotnetcore-3-1-200.1",
2020-03-26T11:58:14.0576757Z "LegacySemVer":"0.6.0-dotnetcore-3-1-200-1",
2020-03-26T11:58:14.0577033Z "LegacySemVerPadded":"0.6.0-dotnetcore-3-1--0001",
2020-03-26T11:58:14.0577170Z "AssemblySemVer":"0.6.0.0",
2020-03-26T11:58:14.0577300Z "AssemblySemFileVer":"0.6.0.0",
2020-03-26T11:58:14.0577752Z "FullSemVer":"0.6.0-dotnetcore-3-1-200.1+95",
2020-03-26T11:58:14.0578514Z "InformationalVersion":"0.6.0-dotnetcore-3-1-200.1+95.Branch.feature-dotnetcore-3.1.200.Sha.9810146ebdd84f7b57cb3784955d1610bd816a2f",
2020-03-26T11:58:14.0578837Z "BranchName":"feature/dotnetcore-3.1.200",
2020-03-26T11:58:14.0579119Z "EscapedBranchName":"feature-dotnetcore-3-1-200",
2020-03-26T11:58:14.0579221Z "Sha":"9810146ebdd84f7b57cb3784955d1610bd816a2f",
2020-03-26T11:58:14.0579363Z "ShortSha":9810146,
2020-03-26T11:58:14.0579792Z "NuGetVersionV2":"0.6.0-dotnetcore-3-1--0001",
2020-03-26T11:58:14.0580059Z "NuGetVersion":"0.6.0-dotnetcore-3-1--0001",
2020-03-26T11:58:14.0580324Z "NuGetPreReleaseTagV2":"dotnetcore-3-1--0001",
2020-03-26T11:58:14.0580580Z "NuGetPreReleaseTag":"dotnetcore-3-1--0001",
2020-03-26T11:58:14.0580916Z "VersionSourceSha":"cb91626f07c674a790c089d857a3351a06f03b6a",
2020-03-26T11:58:14.0581083Z "CommitsSinceVersionSource":95,
2020-03-26T11:58:14.0581225Z "CommitsSinceVersionSourcePadded":"0095",
2020-03-26T11:58:14.0581666Z "CommitDate":"2020-03-26"
2020-03-26T11:58:14.0581751Z }
2020-03-26T11:58:14.0962925Z (node:2743) UnhandledPromiseRejectionWarning: TypeError: (e || "").replace is not a function
2020-03-26T11:58:14.0963104Z at /home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:5:943
2020-03-26T11:58:14.0963261Z at s.toString (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:5:1005)
2020-03-26T11:58:14.0963401Z at o (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:5:372)
2020-03-26T11:58:14.0963540Z at Object.t.issue (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:5:432)
2020-03-26T11:58:14.0963678Z at c (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:9:741)
2020-03-26T11:58:14.0963974Z at Object.t.setFailed (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:9:1482)
2020-03-26T11:58:14.0964121Z at h.setFailed (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:308:1902)
2020-03-26T11:58:14.0964260Z at Object.<anonymous> (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:336:1575)
2020-03-26T11:58:14.0964376Z at Generator.next (<anonymous>)
2020-03-26T11:58:14.0964687Z at s (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:336:170)
2020-03-26T11:58:14.0965174Z (node:2743) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
2020-03-26T11:58:14.0965871Z (node:2743) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Workaround is to set the indicated environment variable:
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true # workaround for https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/ until the execute action is updated
Used in https://github.com/TRUMPF-IoT/C-DEngine/blob/master/.github/workflows/dotnetcore.yml
Related to GitTools/GitVersion#2434
Arguments that were happy running on 0.9.4 are now broken on 0.9.5:
Starting: GitVersion Config
==============================================================================
Task : Execute GitVersion Task
Description : Easy Semantic Versioning (http://semver.org) for projects using Git
Version : 0.9.4
Author : GitTools Contributors
Help : See the [documentation](https://gitversion.net/docs/) for help
==============================================================================
Command: dotnet-gitversion C:/agent/_work/46/s /output json /output buildserver /config C:\agent\_work\46\s\Templates\ComponentVersioning\GitVersion.yml /targetpath C:\agent\_work\46\s\Source /showconfig
C:\agent\_work\_tool\GitVersion.Tool\5.3.7\x64\dotnet-gitversion.exe C:/agent/_work/46/s /output json /output buildserver /config C:\agent\_work\46\s\Templates\ComponentVersioning\GitVersion.yml /targetpath C:\agent\_work\46\s\Source /showconfig
INFO [10/23/20 12:11:21:12] Working directory: C:\agent\_work\46\s\Source
assembly-versioning-scheme: Major
now:
Starting: GitVersion Config
==============================================================================
Task : Execute GitVersion Task
Description : Easy Semantic Versioning (http://semver.org) for projects using Git
Version : 0.9.5
Author : GitTools Contributors
Help : See the [documentation](https://gitversion.net/docs/) for help
==============================================================================
Command: dotnet-gitversion C:/agent/_work/46/s /output json /output buildserver /config C:\agent\_work\46\s\Templates\ComponentVersioning\GitVersion.yml /targetpath C:\agent\_work\46\s\Source /showconfig
C:\agent\_work\_tool\GitVersion.Tool\5.5.0\x64\dotnet-gitversion.exe C:/agent/_work/46/s /output json /output buildserver /config C:\agent\_work\46\s\Templates\ComponentVersioning\GitVersion.yml "/targetpath C:\agent\_work\46\s\Source /showconfig"
Unhandled Exception: GitVersion.WarningException: Could not parse command line parameter '/targetpath C:\agent\_work\46\s\Source /showconfig'.
at GitVersion.ArgumentParser.ParseTargetPath(Arguments arguments, String name, String[] values, String value, Boolean parseEnded) in D:\a\GitVersion\GitVersion\src\GitVersionExe\ArgumentParser.cs:line 194
at GitVersion.ArgumentParser.ParseSwitchArguments(Arguments arguments, NameValueCollection switchesAndValues, Int32 i) in D:\a\GitVersion\GitVersion\src\GitVersionExe\ArgumentParser.cs:line 126
at GitVersion.ArgumentParser.ParseArguments(String[] commandLineArguments) in D:\a\GitVersion\GitVersion\src\GitVersionExe\ArgumentParser.cs:line 88
The suggestion in the readme fails on master branch
- name: Fetch tags and master for GitVersion
run: |
git fetch --tags
git branch --create-reflog master origin/master
Hi,
We're having issues when using the UseGitVersion task on a dotnetcore 3.1 project.
Here are the logs :
Starting: UseGitVersion
==============================================================================
Task : GitVersion Task
Description : Easy Semantic Versioning (http://semver.org) for projects using Git
Version : 5.1.2
Author : GitVersion Contributors
Help : See the [documentation](http://gitversion.readthedocs.org/en/latest/) for help
==============================================================================
--------------------------
Installing GitVersion.Tool version 5.1
--------------------------
/opt/hostedtoolcache/dncs/3.1.100/x64/dotnet tool install GitVersion.Tool --tool-path /home/vsts/work/_temp --version 5.1.2
You can invoke the tool using the following command: dotnet-gitversion
Tool 'gitversion.tool' (version '5.1.2') was successfully installed.
Caching tool: GitVersion.Tool 5.1.2 x64
##[error]Error: EINVAL: invalid argument, readlink '/opt/hostedtoolcache/dncs/3.1.100/x64/dotnet'
Finishing: UseGitVersion
And here's the yaml part of the task :
- task: UseGitVersion@5
inputs:
versionSpec: '5.1'
updateAssemblyInfo: true
I am not sure whether to report here or to https://github.com/GitTools/GitVersion.
I try updating GitVersion to 2.5.0 (and 2.5.4; see JabRef/jabref#6147).
After updating, I get that json != json
:
Unhandled exception. GitVersion.Exceptions.WarningException: Value 'json' cannot be parsed as output type, please use 'json' or 'buildserver'
My config is not too complex:
assembly-versioning-format: '{major}.{minor}.{WeightedPreReleaseNumber}'
assembly-informational-format: '{major}.{minor}{PreReleaseTagWithDash}--{CommitDate}--{ShortSha}'
mode: ContinuousDeployment
branches:
master:
regex: ^master
tag: ''
pre-release-weight: 0
Google did not find the exception, so I think, it's a local issue somehow?
Unhandled exception. GitVersion.Exceptions.WarningException: Value 'json' cannot be parsed as output type, please use 'json' or 'buildserver'
at GitVersion.ArgumentParser.ParseArguments(String[] commandLineArguments) in D:\a\GitVersion\GitVersion\src\GitVersionExe\ArgumentParser.cs:line 320
at GitVersion.Program.<>c__DisplayClass1_0.<CreateHostBuilder>b__2(IServiceProvider sp) in D:\a\GitVersion\GitVersion\src\GitVersionExe\Program.cs:line 28
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
...
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at GitVersion.Program.Main(String[] args) in D:\a\GitVersion\GitVersion\src\GitVersionExe\Program.cs:line 14
at GitVersion.Program.<Main>(String[] args)
(node:2823) UnhandledPromiseRejectionWarning: TypeError: (e || "").replace is not a function
at /home/runner/work/_actions/gittools/actions/v0.9/dist/github/gitversion/execute/bundle.js:5:943
at s.toString (/home/runner/work/_actions/gittools/actions/v0.9/dist/github/gitversion/execute/bundle.js:5:1005)
at o (/home/runner/work/_actions/gittools/actions/v0.9/dist/github/gitversion/execute/bundle.js:5:372)
at Object.t.issue (/home/runner/work/_actions/gittools/actions/v0.9/dist/github/gitversion/execute/bundle.js:5:432)
at c (/home/runner/work/_actions/gittools/actions/v0.9/dist/github/gitversion/execute/bundle.js:9:741)
at Object.t.setFailed (/home/runner/work/_actions/gittools/actions/v0.9/dist/github/gitversion/execute/bundle.js:9:1482)
at h.setFailed (/home/runner/work/_actions/gittools/actions/v0.9/dist/github/gitversion/execute/bundle.js:304:1902)
at Object.<anonymous> (/home/runner/work/_actions/gittools/actions/v0.9/dist/github/gitversion/execute/bundle.js:332:1542)
at Generator.throw (<anonymous>)
at a (/home/runner/work/_actions/gittools/actions/v0.9/dist/github/gitversion/execute/bundle.js:332:221)
(node:2823) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2823) [DEP0018] DeprecationWarn
Hi,
I'm having a hard time finding an overview of the available configuration for the Azure pipelines task for gitversion. There is one example: https://github.com/GitTools/actions/blob/master/docs/examples/azure/gitversion/index.md
Is there any documentation that I have missed? If not, it would be great if an overview of available configuration for this task. Nothing fancy is required - but a list of all inputs would be awesome.
Thanks :)
I'm currently unable to use this task in github actions under .net 5, I end up with the following:
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '3.1.0' was not found.
- The following frameworks were found:
5.0.0 at [/home/runner/.dotnet/shared/Microsoft.NETCore.App]
Is this in any way similar to GitTools/GitVersion#2431 ?
Extract of build log
2020-07-21T05:39:22.0251472Z Tool 'gitversion.tool' (version '5.2.4') was successfully installed.
2020-07-21T05:39:22.1894396Z ##[group]Run gittools/actions/gitversion/[email protected]
2020-07-21T05:39:22.1894880Z with:
2020-07-21T05:39:22.1895155Z useConfigFile: false
2020-07-21T05:39:22.1895456Z updateAssemblyInfo: false
2020-07-21T05:39:22.1895744Z env:
2020-07-21T05:39:22.1896013Z DOTNETSDK_VERSION: 3.1.101
2020-07-21T05:39:22.1896298Z CONFIGURATION: Release
2020-07-21T05:39:22.1896581Z RUN_INTEGRATION_TESTS: true
2020-07-21T05:39:22.1896878Z DOTNET_CLI_TELEMETRY_OPTOUT: 1
2020-07-21T05:39:22.1897185Z DOTNET_ROOT: ../share/dotnet
2020-07-21T05:39:22.1897469Z ##[endgroup]
2020-07-21T05:39:22.2528453Z Command: dotnet-gitversion /home/runner/work/aggregator-cli/aggregator-cli /output json /output buildserver
2020-07-21T05:39:22.2565117Z [command]/opt/hostedtoolcache/GitVersion.Tool/5.2.4/x64/dotnet-gitversion /home/runner/work/aggregator-cli/aggregator-cli /output json /output buildserver
2020-07-21T05:39:22.4760436Z INFO [07/21/20 5:39:22:47] Working directory: /home/runner/work/aggregator-cli/aggregator-cli
2020-07-21T05:39:22.4907582Z INFO [07/21/20 5:39:22:49] Applicable build agent found: 'GitHubActions'.
2020-07-21T05:39:22.4909907Z INFO [07/21/20 5:39:22:49] Branch from build environment: refs/heads/issue-142
2020-07-21T05:39:22.4920479Z INFO [07/21/20 5:39:22:49] Begin: Normalizing git directory for branch 'refs/heads/issue-142'
2020-07-21T05:39:22.5195769Z INFO [07/21/20 5:39:22:51] One remote found (origin -> 'https://github.com/tfsaggregator/aggregator-cli').
2020-07-21T05:39:22.5222316Z INFO [07/21/20 5:39:22:52] Skipping fetching, if GitVersion does not calculate your version as expected you might need to allow fetching or use dynamic repositories
2020-07-21T05:39:22.5260912Z INFO [07/21/20 5:39:22:52] Creating local branch refs/heads/issue-142
2020-07-21T05:39:22.5484313Z INFO [07/21/20 5:39:22:54] Creating local branch from remote tracking 'refs/remotes/origin/feature/slots'.
2020-07-21T05:39:22.5597881Z INFO [07/21/20 5:39:22:55] Creating local branch from remote tracking 'refs/remotes/origin/giuliov/cache-connections'.
2020-07-21T05:39:22.5612375Z INFO [07/21/20 5:39:22:56] Creating local branch from remote tracking 'refs/remotes/origin/giuliov/oauth'.
2020-07-21T05:39:22.5625795Z INFO [07/21/20 5:39:22:56] Creating local branch from remote tracking 'refs/remotes/origin/master'.
2020-07-21T05:39:22.5637148Z INFO [07/21/20 5:39:22:56] HEAD points at branch 'refs/heads/issue-142'.
2020-07-21T05:39:22.5648555Z INFO [07/21/20 5:39:22:56] End: Normalizing git directory for branch 'refs/heads/issue-142' (Took: 72.19ms)
2020-07-21T05:39:22.5649185Z INFO [07/21/20 5:39:22:56] Project root is: /home/runner/work/aggregator-cli/aggregator-cli/
2020-07-21T05:39:22.5649791Z INFO [07/21/20 5:39:22:56] DotGit directory is: /home/runner/work/aggregator-cli/aggregator-cli/.git
2020-07-21T05:39:22.5781513Z INFO [07/21/20 5:39:22:57] Begin: Loading version variables from disk cache
2020-07-21T05:39:22.5791805Z INFO [07/21/20 5:39:22:57] Cache file /home/runner/work/aggregator-cli/aggregator-cli/.git/gitversion_cache/3DAAEA6ABF273F5F3A5B71F8C369F76D3CDE340B.yml not found.
2020-07-21T05:39:22.5792278Z INFO [07/21/20 5:39:22:57] End: Loading version variables from disk cache (Took: 0.92ms)
2020-07-21T05:39:22.5970458Z INFO [07/21/20 5:39:22:59] Using latest commit on specified branch
2020-07-21T05:39:22.5997194Z INFO [07/21/20 5:39:22:59] No branch configuration found for branch issue-142, falling back to default configuration
2020-07-21T05:39:22.6044512Z INFO [07/21/20 5:39:22:60] Begin: Attempting to inherit branch configuration from parent branch
2020-07-21T05:39:22.6098527Z INFO [07/21/20 5:39:22:60] Begin: Finding branch source of 'issue-142'
2020-07-21T05:39:22.6213963Z INFO [07/21/20 5:39:22:62] Begin: Finding merge base between 'issue-142' and 'master'.
2020-07-21T05:39:22.6261237Z INFO [07/21/20 5:39:22:62] Found merge base of 8925d975b18109279de68632fb72ad44712f8e85
2020-07-21T05:39:22.6324560Z INFO [07/21/20 5:39:22:63] Merge base of issue-142' and 'master is 8925d975b18109279de68632fb72ad44712f8e85
2020-07-21T05:39:22.6325378Z INFO [07/21/20 5:39:22:63] End: Finding merge base between 'issue-142' and 'master'. (Took: 11.00ms)
2020-07-21T05:39:22.6330481Z INFO [07/21/20 5:39:22:63] Begin: Finding merge base between 'issue-142' and 'origin/master'.
2020-07-21T05:39:22.6330926Z INFO [07/21/20 5:39:22:63] Found merge base of 8925d975b18109279de68632fb72ad44712f8e85
2020-07-21T05:39:22.6331580Z INFO [07/21/20 5:39:22:63] Merge base of issue-142' and 'origin/master is 8925d975b18109279de68632fb72ad44712f8e85
2020-07-21T05:39:22.6332222Z INFO [07/21/20 5:39:22:63] End: Finding merge base between 'issue-142' and 'origin/master'. (Took: 0.27ms)
2020-07-21T05:39:22.6403235Z INFO [07/21/20 5:39:22:63] Multiple source branches have been found, picking the first one (master).
2020-07-21T05:39:22.6403647Z This may result in incorrect commit counting.
2020-07-21T05:39:22.6403955Z Options were:
2020-07-21T05:39:22.6404261Z master, origin/master
2020-07-21T05:39:22.6405051Z INFO [07/21/20 5:39:22:63] End: Finding branch source of 'issue-142' (Took: 30.33ms)
2020-07-21T05:39:22.6437942Z INFO [07/21/20 5:39:22:64] Begin: Getting branches containing the commit '8925d975b18109279de68632fb72ad44712f8e85'.
2020-07-21T05:39:22.6438386Z INFO [07/21/20 5:39:22:64] Trying to find direct branches.
2020-07-21T05:39:22.6438772Z INFO [07/21/20 5:39:22:64] No direct branches found, searching through all branches.
2020-07-21T05:39:22.6439361Z INFO [07/21/20 5:39:22:64] Searching for commits reachable from 'master'.
2020-07-21T05:39:22.6479864Z INFO [07/21/20 5:39:22:64] The branch 'master' has a matching commit.
2020-07-21T05:39:22.6480507Z INFO [07/21/20 5:39:22:64] Searching for commits reachable from 'origin/master'.
2020-07-21T05:39:22.6484781Z INFO [07/21/20 5:39:22:64] The branch 'origin/master' has a matching commit.
2020-07-21T05:39:22.6485495Z INFO [07/21/20 5:39:22:64] End: Getting branches containing the commit '8925d975b18109279de68632fb72ad44712f8e85'. (Took: 4.80ms)
2020-07-21T05:39:22.6486356Z INFO [07/21/20 5:39:22:64] Begin: Getting branches containing the commit '28709864823a546ba114556bff36b8226f93a35a'.
2020-07-21T05:39:22.6486760Z INFO [07/21/20 5:39:22:64] Trying to find direct branches.
2020-07-21T05:39:22.6487142Z INFO [07/21/20 5:39:22:64] No direct branches found, searching through all branches.
2020-07-21T05:39:22.6487725Z INFO [07/21/20 5:39:22:64] Searching for commits reachable from 'master'.
2020-07-21T05:39:22.6513101Z INFO [07/21/20 5:39:22:65] The branch 'master' has no matching commits.
2020-07-21T05:39:22.6513771Z INFO [07/21/20 5:39:22:65] Searching for commits reachable from 'origin/master'.
2020-07-21T05:39:22.6585476Z INFO [07/21/20 5:39:22:65] The branch 'origin/master' has no matching commits.
2020-07-21T05:39:22.6586228Z INFO [07/21/20 5:39:22:65] End: Getting branches containing the commit '28709864823a546ba114556bff36b8226f93a35a'. (Took: 7.65ms)
2020-07-21T05:39:22.6586655Z INFO [07/21/20 5:39:22:65] Found possible parent branches: master, origin/master
2020-07-21T05:39:22.6587059Z WARN [07/21/20 5:39:22:65] Failed to inherit Increment branch configuration, ended up with: master, origin/master
2020-07-21T05:39:22.6587432Z Falling back to master branch config
2020-07-21T05:39:22.6587801Z INFO [07/21/20 5:39:22:65] End: Attempting to inherit branch configuration from parent branch (Took: 53.27ms)
2020-07-21T05:39:22.6623632Z INFO [07/21/20 5:39:22:66] Running against branch: issue-142 (28709864823a546ba114556bff36b8226f93a35a)
2020-07-21T05:39:22.6641317Z INFO [07/21/20 5:39:22:66] Begin: Calculating base versions
2020-07-21T05:39:22.6749978Z INFO [07/21/20 5:39:22:67] Fallback base version: 0.1.0 with commit count source a1125bc8a77e5a8ac8d1b842ae17ffa85715cc35 (Incremented: None)
2020-07-21T05:39:22.7660931Z INFO [07/21/20 5:39:22:76] Found commit [28709864823a546ba114556bff36b8226f93a35a] matching merge message format: Default
2020-07-21T05:39:22.7757358Z INFO [07/21/20 5:39:22:77] Merge message 'Merge branch 'release/0.9.10'': 0.9.10 with commit count source 782b6ff467d699c68b53d0a5b85e03f561f3f09e (Incremented: None)
2020-07-21T05:39:22.8016565Z INFO [07/21/20 5:39:22:80] Git tag 'v0.9.13': 0.9.13 with commit count source 8925d975b18109279de68632fb72ad44712f8e85 (Incremented: 0.9.14)
2020-07-21T05:39:22.8017527Z INFO [07/21/20 5:39:22:80] Git tag 'v0.9.12': 0.9.12 with commit count source f89f53e781120a33bf110154554233f025b26c5a (Incremented: 0.9.13)
2020-07-21T05:39:22.8018409Z INFO [07/21/20 5:39:22:80] Git tag 'v0.9.11': 0.9.11 with commit count source ff46602262e4b1fef7f679947bad6b8103d1e407 (Incremented: 0.9.12)
2020-07-21T05:39:22.8020432Z INFO [07/21/20 5:39:22:80] Git tag 'v0.9.10': 0.9.10 with commit count source 057718c2397063e540374de64c79c9d9becce80f (Incremented: 0.9.11)
2020-07-21T05:39:22.8021599Z INFO [07/21/20 5:39:22:80] Git tag 'v0.9.9': 0.9.9 with commit count source 251e71107d297b11756722bc16048b93b6cf50c8 (Incremented: 0.9.10)
2020-07-21T05:39:22.8082855Z INFO [07/21/20 5:39:22:80] Found multiple base versions which will produce the same SemVer (0.9.14), taking oldest source for commit counting (Git tag 'v0.9.13')
2020-07-21T05:39:22.8088195Z INFO [07/21/20 5:39:22:80] Base version used: Git tag 'v0.9.13': 0.9.13 with commit count source 8925d975b18109279de68632fb72ad44712f8e85 (Incremented: 0.9.14)
2020-07-21T05:39:22.8100649Z INFO [07/21/20 5:39:22:80] End: Calculating base versions (Took: 144.24ms)
2020-07-21T05:39:22.8192155Z INFO [07/21/20 5:39:22:80] 1 commits found between 8925d975b18109279de68632fb72ad44712f8e85 and 28709864823a546ba114556bff36b8226f93a35a
2020-07-21T05:39:22.8192588Z INFO [07/21/20 5:39:22:80] Using branch name to calculate version tag
2020-07-21T05:39:22.8195230Z INFO [07/21/20 5:39:22:81] Begin: Getting version tags from branch 'refs/heads/issue-142'.
2020-07-21T05:39:22.8196421Z INFO [07/21/20 5:39:22:81] End: Getting version tags from branch 'refs/heads/issue-142'. (Took: 8.30ms)
2020-07-21T05:39:22.8283273Z INFO [07/21/20 5:39:22:82] Begin: Creating dictionary
2020-07-21T05:39:22.8309421Z INFO [07/21/20 5:39:22:83] End: Creating dictionary (Took: 5.15ms)
2020-07-21T05:39:22.8344693Z INFO [07/21/20 5:39:22:83] Begin: Storing version variables to cache file /home/runner/work/aggregator-cli/aggregator-cli/.git/gitversion_cache/3DAAEA6ABF273F5F3A5B71F8C369F76D3CDE340B.yml
2020-07-21T05:39:22.8906092Z INFO [07/21/20 5:39:22:89] End: Storing version variables to cache file /home/runner/work/aggregator-cli/aggregator-cli/.git/gitversion_cache/3DAAEA6ABF273F5F3A5B71F8C369F76D3CDE340B.yml (Took: 55.92ms)
2020-07-21T05:39:22.8914373Z INFO [07/21/20 5:39:22:89] Running on Unix.
2020-07-21T05:39:22.8915227Z INFO [07/21/20 5:39:22:89] Applicable build agent found: 'GitHubActions'.
2020-07-21T05:39:22.8919531Z Executing GenerateSetVersionMessage for 'GitHubActions'.
2020-07-21T05:39:22.8919787Z
2020-07-21T05:39:22.8920426Z Executing GenerateBuildLogOutput for 'GitHubActions'.
2020-07-21T05:39:22.8978205Z ***
2020-07-21T05:39:22.8978493Z "Major":0,
2020-07-21T05:39:22.8978767Z "Minor":9,
2020-07-21T05:39:22.8979033Z "Patch":14,
2020-07-21T05:39:22.8979503Z "PreReleaseTag":"issue-142.1",
2020-07-21T05:39:22.8979980Z "PreReleaseTagWithDash":"-issue-142.1",
2020-07-21T05:39:22.8980432Z "PreReleaseLabel":"issue-142",
2020-07-21T05:39:22.8980731Z "PreReleaseNumber":1,
2020-07-21T05:39:22.8981023Z "WeightedPreReleaseNumber":1,
2020-07-21T05:39:22.8981311Z "BuildMetaData":1,
2020-07-21T05:39:22.8981606Z "BuildMetaDataPadded":"0001",
2020-07-21T05:39:22.8982154Z "FullBuildMetaData":"1.Branch.issue-142.Sha.28709864823a546ba114556bff36b8226f93a35a",
2020-07-21T05:39:22.8982502Z "MajorMinorPatch":"0.9.14",
2020-07-21T05:39:22.8982937Z "SemVer":"0.9.14-issue-142.1",
2020-07-21T05:39:22.8983389Z "LegacySemVer":"0.9.14-issue-142-1",
2020-07-21T05:39:22.8984164Z "LegacySemVerPadded":"0.9.14-issue-142-0001",
2020-07-21T05:39:22.8984595Z "AssemblySemVer":"0.9.14.0",
2020-07-21T05:39:22.8984894Z "AssemblySemFileVer":"0.9.14.0",
2020-07-21T05:39:22.8985360Z "FullSemVer":"0.9.14-issue-142.1+1",
2020-07-21T05:39:22.8985955Z "InformationalVersion":"0.9.14-issue-142.1+1.Branch.issue-142.Sha.28709864823a546ba114556bff36b8226f93a35a",
2020-07-21T05:39:22.8986447Z "BranchName":"issue-142",
2020-07-21T05:39:22.8986888Z "EscapedBranchName":"issue-142",
2020-07-21T05:39:22.8987209Z "Sha":"28709864823a546ba114556bff36b8226f93a35a",
2020-07-21T05:39:22.8987522Z "ShortSha":2870986,
2020-07-21T05:39:22.8987968Z "NuGetVersionV2":"0.9.14-issue-142-0001",
2020-07-21T05:39:22.8988432Z "NuGetVersion":"0.9.14-issue-142-0001",
2020-07-21T05:39:22.8988906Z "NuGetPreReleaseTagV2":"issue-142-0001",
2020-07-21T05:39:22.8989363Z "NuGetPreReleaseTag":"issue-142-0001",
2020-07-21T05:39:22.8989708Z "VersionSourceSha":"8925d975b18109279de68632fb72ad44712f8e85",
2020-07-21T05:39:22.8990069Z "CommitsSinceVersionSource":1,
2020-07-21T05:39:22.8990393Z "CommitsSinceVersionSourcePadded":"0001",
2020-07-21T05:39:22.8990849Z "CommitDate":"2020-07-20"
2020-07-21T05:39:22.8991364Z ***
2020-07-21T05:39:22.9225334Z (node:2982) UnhandledPromiseRejectionWarning: TypeError: (e || "").replace is not a function
2020-07-21T05:39:22.9225791Z at /home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:5:943
2020-07-21T05:39:22.9226199Z at s.toString (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:5:1005)
2020-07-21T05:39:22.9226607Z at o (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:5:372)
2020-07-21T05:39:22.9227017Z at Object.t.issue (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:5:432)
2020-07-21T05:39:22.9227432Z at c (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:9:741)
2020-07-21T05:39:22.9227960Z at Object.t.setFailed (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:9:1482)
2020-07-21T05:39:22.9228390Z at h.setFailed (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:308:1902)
2020-07-21T05:39:22.9228806Z at Object.<anonymous> (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:336:1575)
2020-07-21T05:39:22.9229179Z at Generator.next (<anonymous>)
2020-07-21T05:39:22.9229544Z at s (/home/runner/work/_actions/gittools/actions/v0.9.2/dist/github/gitversion/execute/bundle.js:336:170)
2020-07-21T05:39:22.9230013Z (node:2982) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
2020-07-21T05:39:22.9230875Z (node:2982) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
2020-07-21T05:39:22.9319133Z ##[group]Run rm $GITHUB_WORKSPACE/src/integrationtests-cli/logon-data.json
2020-07-21T05:39:22.9319546Z ๏ฟฝ[36;1mrm $GITHUB_WORKSPACE/src/integrationtests-cli/logon-data.json๏ฟฝ[0m
2020-07-21T05:39:22.9359816Z shell: /bin/bash -e ***0***
2020-07-21T05:39:22.9360113Z env:
2020-07-21T05:39:22.9360408Z DOTNETSDK_VERSION: 3.1.101
2020-07-21T05:39:22.9360696Z CONFIGURATION: Release
2020-07-21T05:39:22.9360978Z RUN_INTEGRATION_TESTS: true
2020-07-21T05:39:22.9361268Z DOTNET_CLI_TELEMETRY_OPTOUT: 1
2020-07-21T05:39:22.9361565Z DOTNET_ROOT: ../share/dotnet
2020-07-21T05:39:22.9361858Z GitVersion_Major: 0
2020-07-21T05:39:22.9362157Z GitVersion_Minor: 9
2020-07-21T05:39:22.9362434Z GitVersion_Patch: 14
2020-07-21T05:39:22.9362723Z GitVersion_PreReleaseTag: issue-142.1
2020-07-21T05:39:22.9363040Z GitVersion_PreReleaseTagWithDash: -issue-142.1
2020-07-21T05:39:22.9363541Z GitVersion_PreReleaseLabel: issue-142
2020-07-21T05:39:22.9363867Z GitVersion_PreReleaseNumber: 1
2020-07-21T05:39:22.9364221Z GitVersion_WeightedPreReleaseNumber: 1
2020-07-21T05:39:22.9364528Z GitVersion_BuildMetaData: 1
2020-07-21T05:39:22.9364840Z GitVersion_BuildMetaDataPadded: 0001
2020-07-21T05:39:22.9365201Z GitVersion_FullBuildMetaData: 1.Branch.issue-142.Sha.28709864823a546ba114556bff36b8226f93a35a
2020-07-21T05:39:22.9365544Z GitVersion_MajorMinorPatch: 0.9.14
2020-07-21T05:39:22.9365852Z GitVersion_SemVer: 0.9.14-issue-142.1
2020-07-21T05:39:22.9366466Z GitVersion_LegacySemVer: 0.9.14-issue-142-1
2020-07-21T05:39:22.9366833Z GitVersion_LegacySemVerPadded: 0.9.14-issue-142-0001
2020-07-21T05:39:22.9367153Z GitVersion_AssemblySemVer: 0.9.14.0
2020-07-21T05:39:22.9367462Z GitVersion_AssemblySemFileVer: 0.9.14.0
2020-07-21T05:39:22.9367778Z GitVersion_FullSemVer: 0.9.14-issue-142.1+1
2020-07-21T05:39:22.9368162Z GitVersion_InformationalVersion: 0.9.14-issue-142.1+1.Branch.issue-142.Sha.28709864823a546ba114556bff36b8226f93a35a
2020-07-21T05:39:22.9368513Z GitVersion_BranchName: issue-142
2020-07-21T05:39:22.9368811Z GitVersion_EscapedBranchName: issue-142
2020-07-21T05:39:22.9369133Z GitVersion_Sha: 28709864823a546ba114556bff36b8226f93a35a
2020-07-21T05:39:22.9369443Z GitVersion_ShortSha: 2870986
2020-07-21T05:39:22.9369761Z GitVersion_NuGetVersionV2: 0.9.14-issue-142-0001
2020-07-21T05:39:22.9370088Z GitVersion_NuGetVersion: 0.9.14-issue-142-0001
2020-07-21T05:39:22.9370411Z GitVersion_NuGetPreReleaseTagV2: issue-142-0001
2020-07-21T05:39:22.9370735Z GitVersion_NuGetPreReleaseTag: issue-142-0001
2020-07-21T05:39:22.9371083Z GitVersion_VersionSourceSha: 8925d975b18109279de68632fb72ad44712f8e85
2020-07-21T05:39:22.9371424Z GitVersion_CommitsSinceVersionSource: 1
2020-07-21T05:39:22.9371740Z GitVersion_CommitsSinceVersionSourcePadded: 0001
2020-07-21T05:39:22.9372048Z GitVersion_CommitDate: 2020-07-20
2020-07-21T05:39:22.9372345Z ##[endgroup]
Renaming the branch from issue-142
to issue_142
fixed.
I have a shared GitVersion.yml
to use in a build template, so I have two checkout tasks: one to check out the repo with the config file, and the other to check out the repo to be built.
This creates a directory structure like so:
d:/a/1/s/
CurrentRepo
TemplateRepo
My gitversion/execute
task is like the following:
- task: gitversion/execute@0
displayName: "Run gitversion"
inputs:
targetPath: '$(Build.SourcesDirectory)/CurrentRepo'
useConfigFile: true
configFilePath: '$(Build.SourcesDirectory)/TemplateRepo/GitVersion.yml'
Using this targetPath
results in a doubled up path like d:/a/1/s/d:/a/1/s/CurrentRepo
and the .git
directory cannot be found. This is due to the path join here.
If I set targetPath
to a relative directory such as ./CurrentRepo
, it fails because the directory cannot be found.
As it is, I cannot see a way that this feature will work because of the discrepancy between the directory existence check and the joined path.
Add Unit tests, now that we use dependency injection, it should be quite easy
I'm using the UseGitVersion task in a set of jobs in Azure DevOps. The first job builds the solution, which is then published as an artifact. The subsequent jobs consume this artifact and are used to publish nuget packages. By default UseGitVersion targets the $(System.DefaultWorkingDirectory) (c:\agent_work\1\s)
, but as the artifact is downloaded into $(Pipeline.Workspace) (c:\agent_work\1)
UseGitVersion needs to target the artifact instead.
I tried using the targetPath
parameter to change where UseGitVersion operates but ran into difficulty.
When using an absolute path for targetPath
:
variables:
buildArtifactName: 'rezare_lib'
buildArtifact: '$(Pipeline.Workspace)/$(buildArtifactName)'
- task: UseGitVersion@5
displayName: GitVersion
inputs:
versionSpec: '5.x'
useConfigFile: true
configFilePath: '$(buildArtifact)/Rezare.Lib-GitVersion.yml'
includePrerelease: true
additionalArguments: '/updateassemblyinfo "$(buildArtifact)/Rezare.Lib/Properties/AssemblyInfo.cs"'
targetPath: '$(buildArtifact)'
I get the following:
Tool 'gitversion.tool' (version '5.1.3') was successfully installed.
Caching tool: GitVersion.Tool 5.1.3 x64
Prepending PATH environment variable with directory: C:\hostedtoolcache\windows\GitVersion.Tool\5.1.3\x64
C:\hostedtoolcache\windows\GitVersion.Tool\5.1.3\x64\dotnet-gitversion.exe d:/a/1/s/d:/a/1/rezare_lib /output buildserver /nofetch /config d:\a\1\rezare_lib\Rezare.Lib-GitVersion.yml /updateassemblyinfo d:\a\1/rezare_lib/Rezare.Lib/Properties/AssemblyInfo.cs
WARN [02/16/20 22:24:15:94] The working directory 'd:/a/1/s/d:/a/1/rezare_lib' does not exist.
INFO [02/16/20 22:24:15:95] IsDynamicGitRepository: False
ERROR [02/16/20 22:24:16:39] An unexpected error occurred:
System.IO.DirectoryNotFoundException: Can't find the .git directory in
at GitVersion.GitPreparer.GetProjectRootDirectoryInternal() in D:\a\1\s\src\GitVersionCore\GitPreparer.cs:line 94
at GitVersion.GitPreparer.GetProjectRootDirectory() in D:\a\1\s\src\GitVersionCore\GitPreparer.cs:line 27
at GitVersion.Configuration.ConfigFileLocator.Verify(IGitPreparer gitPreparer) in D:\a\1\s\src\GitVersionCore\Configuration\ConfigFileLocator.cs:line 61
at GitVersion.GitVersionExecutor.VerifyConfiguration() in D:\a\1\s\src\GitVersionExe\GitVersionExecutor.cs:line 153
at GitVersion.GitVersionExecutor.VerifyArgumentsAndRun(Arguments arguments) in D:\a\1\s\src\GitVersionExe\GitVersionExecutor.cs:line 105
INFO [02/16/20 22:24:16:39]
INFO [02/16/20 22:24:16:39] Attempting to show the current git graph (please include in issue):
INFO [02/16/20 22:24:16:39] Showing max of 100 commits
ERROR [02/16/20 22:24:16:40] Couldn't dump the git graph due to the following error: System.ComponentModel.Win32Exception (267): The directory name is invalid.
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at GitVersion.Helpers.ProcessHelper.Start(ProcessStartInfo startInfo) in D:\a\1\s\src\GitVersionCore\Helpers\ProcessHelper.cs:line 26
at GitVersion.Helpers.ProcessHelper.Run(Action1 output, Action
1 errorOutput, TextReader input, String exe, String args, String workingDirectory, KeyValuePair2[] environmentalVariables) in D:\a\1\s\src\GitVersionCore\Helpers\ProcessHelper.cs:line 120 at GitVersion.Extensions.LibGitExtensions.DumpGraph(String workingDirectory, Action
1 writer, Nullable1 maxCommits) in D:\a\1\s\src\GitVersionCore\Extensions\LibGitExtensions.cs:line 120 at GitVersion.GitVersionExecutor.VerifyArgumentsAndRun(Arguments arguments) in D:\a\1\s\src\GitVersionExe\GitVersionExecutor.cs:line 138 INFO [02/16/20 22:24:15:93] Applicable build agent found: 'AzurePipelines'.WARN [02/16/20 22:24:15:94] The working directory 'd:/a/1/s/d:/a/1/rezare_lib' does not exist.INFO [02/16/20 22:24:15:95] IsDynamicGitRepository: FalseERROR [02/16/20 22:24:16:39] An unexpected error occurred: System.IO.DirectoryNotFoundException: Can't find the .git directory in at GitVersion.GitPreparer.GetProjectRootDirectoryInternal() in D:\a\1\s\src\GitVersionCore\GitPreparer.cs:line 94 at GitVersion.GitPreparer.GetProjectRootDirectory() in D:\a\1\s\src\GitVersionCore\GitPreparer.cs:line 27 at GitVersion.Configuration.ConfigFileLocator.Verify(IGitPreparer gitPreparer) in D:\a\1\s\src\GitVersionCore\Configuration\ConfigFileLocator.cs:line 61 at GitVersion.GitVersionExecutor.VerifyConfiguration() in D:\a\1\s\src\GitVersionExe\GitVersionExecutor.cs:line 153 at GitVersion.GitVersionExecutor.VerifyArgumentsAndRun(Arguments arguments) in D:\a\1\s\src\GitVersionExe\GitVersionExecutor.cs:line 105INFO [02/16/20 22:24:16:39] INFO [02/16/20 22:24:16:39] Attempting to show the current git graph (please include in issue): INFO [02/16/20 22:24:16:39] Showing max of 100 commitsERROR [02/16/20 22:24:16:40] Couldn't dump the git graph due to the following error: System.ComponentModel.Win32Exception (267): The directory name is invalid. at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at GitVersion.Helpers.ProcessHelper.Start(ProcessStartInfo startInfo) in D:\a\1\s\src\GitVersionCore\Helpers\ProcessHelper.cs:line 26 at GitVersion.Helpers.ProcessHelper.Run(Action
1 output, Action1 errorOutput, TextReader input, String exe, String args, String workingDirectory, KeyValuePair
2[] environmentalVariables) in D:\a\1\s\src\GitVersionCore\Helpers\ProcessHelper.cs:line 120
at GitVersion.Extensions.LibGitExtensions.DumpGraph(String workingDirectory, Action1 writer, Nullable
1 maxCommits) in D:\a\1\s\src\GitVersionCore\Extensions\LibGitExtensions.cs:line 120
Finishing: GitVersion
So I tried making the path relative:
- task: UseGitVersion@5
displayName: GitVersion
inputs:
versionSpec: '5.x'
useConfigFile: true
configFilePath: '$(buildArtifact)/Rezare.Lib-GitVersion.yml'
includePrerelease: true
additionalArguments: '/updateassemblyinfo "$(buildArtifact)/Rezare.Lib/Properties/AssemblyInfo.cs"'
targetPath: '../$(buildArtifactName)'
Which gives this:
You can invoke the tool using the following command: dotnet-gitversion
Tool 'gitversion.tool' (version '5.1.3') was successfully installed.
Caching tool: GitVersion.Tool 5.1.3 x64
Prepending PATH environment variable with directory: C:\hostedtoolcache\windows\GitVersion.Tool\5.1.3\x64
##[error]Error: Directory not found at ../rezare_lib
Finishing: GitVersion
Is this a bug, or am I just trying to use targetPath
incorrectly for re-specifying where UseGitVersion should operate?
Reference:
GitTools/GitVersion#2211
GitTools/GitVersion#1809
The moment there is a develop/alpha/prerelease in github releases the tool fails.
This bug prevents the ability to release prerelease builds to github.
Delete the prerelease from github releases, and the tool works again.
See:
https://github.com/ptr727/PlexCleaner/blob/develop/.github/workflows/BuildPublishPipeline.yml
INFO [11/23/20 13:17:14:00] Base version used: Git tag '1.12.0-alpha0003': 1.12.0-alpha.3 with commit count source ef7d358fad3f6bd91c774c127a0cf8cc759e0e7c
INFO [11/23/20 13:17:14:00] End: Calculating base versions (Took: 437.31ms)
ERROR [11/23/20 13:17:14:01] An unexpected error occurred:
System.NotSupportedException: Mainline development mode doesn't yet support pre-release tags on master
at GitVersion.VersionCalculation.MainlineVersionCalculator.FindMainlineModeVersion(BaseVersion baseVersion)
at GitVersion.VersionCalculation.NextVersionCalculator.FindVersion()
at GitVersion.GitVersionTool.CalculateVersionVariables()
at GitVersion.GitVersionExecutor.RunGitVersionTool(GitVersionOptions gitVersionOptions)
We're using a manually checked in version of GitVersion at the moment, and are looking to migrate to the recently released Azure DevOps tasks.
We have tried adding the following tasks:
- task: gitversion-setup@5
displayName: Install GitVersion
inputs:
versionSpec: '5.x'
- task: gitversion-execute@5
displayName: Run GitVersion
This resulted in the $(GitVersion.Major)
variable not being found.
We've also tried adding the /output
variable to the execute task, but something about the syntax is not valid.
inputs:
additionalArguments: '/output buildserver'
Unhandled Exception: GitVersion.Exceptions.WarningException: Could not parse command line parameter '/output buildserver'.
Local (Desired behaviour)
Local cmd line (using GitVersion v5.6.0 - installed via dotnet tool install) reports the following:
"Major":1,
"Minor":0,
"Patch":76,
"PreReleaseTag":""
Azure DevOps
Both gittools/execute@0 (using GitVersion v5.6.0 via gittools/setup@0) and GitVersion.Tool (using GitVersion v5.6.0 - installed via dotnet tool install) report the following in Azure DevOps:
"Major":1,
"Minor":0,
"Patch":0,
"PreReleaseTag":76
Observations
Since the most recent update, the $(Patch) variable is not being populated, or is being populated as an empty string, when running the task on a new branch. It has also occurred by merging master into an existing branch, and then running that through the pipeline.
The value is being calculated by GitVersion:
Executing GenerateBuildLogOutput for 'AzurePipelines'.
{
"Major":4,
"Minor":6,
"Patch":0,
...
Referring to it, however does not work:
- task: PowerShell@2
displayName: Get-Version
enabled: true
inputs:
targetType: 'filepath'
filePath: 'build/Scripts/Get-Version.ps1'
arguments: -Verbose `
-GitVersionMajor $(Major) `
-GitVersionMinor $(Minor) `
-GitVersionPatch $(Patch) `
...
C:\agent\_work\149\s\build\Scripts\Get-Version.ps1' -Verbose ` -GitVersionMajor 4 ` -GitVersionMinor 6 ` -GitVersionPatch ` ...
The code sample below produces the error GitVersion.SemVer: command not found
- task: UseGitVersion@5
inputs:
versionSpec: '5.x'
...
- script: npm version $(GitVersion.SemVer) --no-git-tag-version
displayName: 'NPM Version'
Workaround
Based on other issues, rolling back to 5.1.2
fixes the issue for me.
When I try to use azure tasks from an example I have got this error
stages:
- stage: gitversion
# condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.SourceBranch'], 'refs/heads/develop')))
jobs:
- job: gitversion
steps:
- task: gitversion/setup@0
displayName: Install GitVersion
inputs:
versionSpec: "5.1.3"
- task: gitversion/execute@0
displayName: Use GitVersion
- script: |
echo FullSemVer: $(fullSemVer)
echo ##vso[build.updatebuildnumber]$(fullSemVer)
echo Major: ${{ steps.gitversion.outputs.major }}
echo Minor: ${{ steps.gitversion.outputs.minor }}
echo Patch: ${{ steps.gitversion.outputs.patch }}
echo PreReleaseTag: ${{ steps.gitversion.outputs.preReleaseTag }}
echo PreReleaseTagWithDash: ${{ steps.gitversion.outputs.preReleaseTagWithDash }}
echo PreReleaseLabel: ${{ steps.gitversion.outputs.preReleaseLabel }}
echo PreReleaseNumber: ${{ steps.gitversion.outputs.preReleaseNumber }}
echo WeightedPreReleaseNumber: ${{ steps.gitversion.outputs.weightedPreReleaseNumber }}
echo BuildMetaData: ${{ steps.gitversion.outputs.buildMetaData }}
echo BuildMetaDataPadded: ${{ steps.gitversion.outputs.buildMetaDataPadded }}
echo FullBuildMetaData: ${{ steps.gitversion.outputs.fullBuildMetaData }}
echo MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}
echo SemVer: ${{ steps.gitversion.outputs.semVer }}
echo LegacySemVer: ${{ steps.gitversion.outputs.legacySemVer }}
echo LegacySemVerPadded: ${{ steps.gitversion.outputs.legacySemVerPadded }}
echo AssemblySemVer: ${{ steps.gitversion.outputs.assemblySemVer }}
echo AssemblySemFileVer: ${{ steps.gitversion.outputs.assemblySemFileVer }}
echo InformationalVersion: ${{ steps.gitversion.outputs.informationalVersion }}
echo BranchName: ${{ steps.gitversion.outputs.branchName }}
echo Sha: ${{ steps.gitversion.outputs.sha }}
echo ShortSha: ${{ steps.gitversion.outputs.shortSha }}
echo NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}
echo NuGetVersion: ${{ steps.gitversion.outputs.nuGetVersion }}
echo NuGetPreReleaseTagV2: ${{ steps.gitversion.outputs.nuGetPreReleaseTagV2 }}
echo NuGetPreReleaseTag: ${{ steps.gitversion.outputs.nuGetPreReleaseTag }}
echo VersionSourceSha: ${{ steps.gitversion.outputs.versionSourceSha }}
echo CommitsSinceVersionSource: ${{ steps.gitversion.outputs.commitsSinceVersionSource }}
echo CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}
echo CommitDate: ${{ steps.gitversion.outputs.commitDate }}
/azure-pipelines.yml (Line: 35, Col: 21): Unrecognized value: 'steps'. Located at position 853 within expression: format('echo FullSemVer: $(fullSemVer) echo ##vso[build.updatebuildnumber]$(fullSemVer) echo Major: {0} echo Minor: {1} echo Patch: {2} echo PreReleaseTag: {3} echo PreReleaseTagWithDash: {4} echo PreReleaseLabel: {5} echo PreReleaseNumber: {6} echo WeightedPreReleaseNumber: {7} echo BuildMetaData: {8} echo BuildMetaDataPadded: {9} echo FullBuildMetaData: {10} echo MajorMinorPatch: {[...]
So how can I access to output from @execute task?
GitHub is deprecating set-env
and add-path
commands, causing the GitVersion action to log the following warning when executed:
The
set-env
command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
I'm not sure what the fix is, because we are using v1.2.6
of @actions/core
already.
Action authors who are using the toolkit should update the
@actions/core
package tov1.2.6
or greater to get the updatedaddPath
andexportVariable
functions.
The github step
- name: Install GitReleaseManager
uses: gittools/actions/gitreleasemanager/[email protected]
with:
versionSpec: '0.11.x
fails with the following error:
Error: Unable to process command '::set-env name=DOTNET_CLI_TELEMETRY_OPTOUT::1' successfully.
Error: The `set-env` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
--------------------------
Installing GitReleaseManager.Tool version 0.11.x
--------------------------
Command: dotnet tool install GitReleaseManager.Tool --tool-path /home/runner/work/_temp/952164dd-64f6-4e23-9135-e4954aa1a005 --version 0.11.0
/usr/bin/dotnet tool install GitReleaseManager.Tool --tool-path /home/runner/work/_temp/952164dd-64f6-4e23-9135-e4954aa1a005 --version 0.11.0
You can invoke the tool using the following command: dotnet-gitreleasemanager
Tool 'gitreleasemanager.tool' (version '0.11.0') was successfully installed.
Error: Unable to process command '::add-path::/opt/hostedtoolcache/GitReleaseManager.Tool/0.11.0/x64' successfully.
Error: The `add-path` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
The
set-env command is disabled.
now and therefore the tool cant be used at the moment.
try dotnet core 3.1.200 but getting;
--------------------------
Installing GitVersion.Tool version 5.1.x
--------------------------
Command: dotnet tool install GitVersion.Tool --tool-path /home/runner/work/_temp/6bd9dc74-8977-4580-a6d9-42733657444b --version 5.1.3
/usr/bin/dotnet tool install GitVersion.Tool --tool-path /home/runner/work/_temp/6bd9dc74-8977-4580-a6d9-42733657444b --version 5.1.3
A compatible installed .NET Core SDK for global.json version [3.1.200] from [/home/runner/work/hypeengine/hypeengine/global.json] was not found
Install the [3.1.200] .NET Core SDK or update [/home/runner/work/hypeengine/hypeengine/global.json] with an installed .NET Core SDK:
I'm having a strange exception with the github action : it can't parse the /output json
parameter.
I no clue why this happens, since the parsing is case insensitive...
Here's the related build log : https://github.com/rducom/ParallelAsync/pull/1/checks?check_run_id=493761482
Run gittools/actions/gitversion/[email protected]
with:
useConfigFile: false
updateAssemblyInfo: false
env:
DOTNET_ROOT: /opt/hostedtoolcache/dncs/3.1.101/x64
DOTNET_CLI_TELEMETRY_OPTOUT: 1
Command: dotnet-gitversion /home/runner/work/ParallelAsync/ParallelAsync /output json
/opt/hostedtoolcache/GitVersion.Tool/5.2.0/x64/dotnet-gitversion /home/runner/work/ParallelAsync/ParallelAsync /output json
Unhandled exception. GitVersion.Exceptions.WarningException: Value 'json' cannot be parsed as output type, please use 'json' or 'buildserver'
at GitVersion.ArgumentParser.ParseArguments(String[] commandLineArguments) in D:\a\GitVersion\GitVersion\src\GitVersionExe\ArgumentParser.cs:line 320
My company uses main
as the name of the master branch and the gitversion execute task fails with the message: Could not find a 'develop' or 'master' branch, neither locally nor remotely.
I also tried:
task: gitversion/execute@0
displayName: "Run gitversion"
inputs:
additionalArguments:
branches:
master:
regex: ^main$
but that failed.
Moved from GitTools/GitVersion#2473
Describe the bug
Running gitversion with /output file parameter gets overwritten. Actually it gets overwritten twice with two different parameters - json and buildserver.
C:\hostedtoolcache\windows\GitVersion.Tool\5.5.1\x64\dotnet-gitversion.exe D:/a/1/s /output json /output buildserver /config /output file
Being able to specify intended output, perhaps as parameter
buildserver output type gets precedence over both json and file outputs
Expose output as parameter
Create task that will save GitVersion.json file using /output file parameter
I'm not able to create json artifact to reuse it in other jobs
In my build script I set the updateAssemblyInfo
parameter to true
but the AssemblyInfo.cs files keep the original value.
Source example:
https://github.com/tfsaggregator/aggregator-cli/blob/d25e1b8284d958c786ac7116f816da7e5fa011f2/.github/workflows/release-to-GitHub.yml#L26-L30
Log
Run gittools/actions/[email protected]
with:
updateAssemblyInfo: true
useConfigFile: false
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_ROOT: ../share/dotnet
/opt/hostedtoolcache/GitVersion.Tool/5.1.3/x64/dotnet-gitversion /home/runner/work/aggregator-cli/aggregator-cli /output json
I do not want to keep updating my build scripts for every tool release.
I want to stick to a major version and expect no breaking changes.
If I specify a subversion I'd like the latest to be auto selected.
Works: uses: gittools/actions/gitversion/[email protected]
Does not work: uses: gittools/actions/gitversion/execute@v0
Uses an old version: uses: gittools/actions/gitversion/[email protected]
See here for a relevant discussion:
https://github.community/t/versioning-guidance-for-authoring-and-consuming-actions/138763/3
If you use UseDotnet task before GitVesion you will get error. (UseGitVersion and GitTools tasks are the same)
- task: UseDotNet@2
displayName: ".NET Core 3.1.x"
inputs:
packageType: 'sdk'
version: '3.1.x'
- task: gitversion/setup@0
inputs:
versionSpec: '5.x'
- task: gitversion/execute@0
inputs:
useConfigFile: true
configFilePath: 'GitVersion.yml'
additionalArguments: ''
You will get this error:
##[error]Error: EINVAL: invalid argument, readlink '/opt/hostedtoolcache/dotnet/dotnet'
When I try to update the AssemblyInfo.cs files by setting the updateAssemblyInfo: true
I get the following error:
AssemblyInfoFilename file not found at
Might be related to this issue on the GitVersion repo.
You can view the error in action at:
https://github.com/saturdaymp/XPlugins.iOS.BEMCheckBox/runs/710150101?check_suite_focus=true
To reproduce:
name: CI
on: [push]
jobs:
build:
name: Build Job
runs-on: macos-latest
defaults:
run:
working-directory: Source
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Fetch history for GitVersion
run: git fetch --prune --unshallow
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.3.4'
- name: Generate Version Info using GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
updateAssemblyInfo: true
- name: Display GitVersion values
run: |
echo "Major: ${{ steps.gitversion.outputs.major }}"
echo "Minor: ${{ steps.gitversion.outputs.minor }}"
echo "Patch: ${{ steps.gitversion.outputs.patch }}"
Run gittools/actions/gitversion/[email protected]
with:
updateAssemblyInfo: true
useConfigFile: false
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
##[error]Error: AssemblyInfoFilename file not found at
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.