The new task throws if there is no tag yet defined. The call in D:\Git\Sampler\.build\tasks\Create_Release_Git_Tag.build.ps1::115 should be in a try-catch block.
Verbose logs
===============================================================================
CREATE RELEASE GIT TAG
Creates a git tag for the release that is published to a Gallery
-------------------------------------------------------------------------------
/publishAzDo/Create_Release_Git_Tag
C:\BuildWorker1\_work\1\s\output\RequiredModules\Sampler\0.115.0\tasks\Create_Release_Git_Tag.build.ps1:98
Project Name = 'DscConfig.Demo'
Source Path = 'C:\BuildWorker1\_work\1\s\source'
Output Directory = 'C:\BuildWorker1\_work\1\s\output'
Release Notes path = 'C:\BuildWorker1\_work\1\s\output\ReleaseNotes.md'
Built Module Subdirectory = 'C:\BuildWorker1\_work\1\s\output\Module'
Module Manifest Path (src) = 'C:\BuildWorker1\_work\1\s\source\DscConfig.Demo.psd1'
Versioned Output Directory = 'True'
Built Module Manifest = 'C:\BuildWorker1\_work\1\s\output\Module\DscConfig.Demo\2.0.0\DscConfig.Demo.psd1'
Built Module Base = 'C:\BuildWorker1\_work\1\s\output\Module\DscConfig.Demo\2.0.0'
Module Version = '2.0.0-preview0002'
Module Version Folder = '2.0.0'
Pre-release Tag = 'preview0002'
Built Module Root Script = 'C:\BuildWorker1\_work\1\s\output\Module\DscConfig.Demo\2.0.0\DscConfig.Demo.psm1'
ERROR: fatal: cannot describe '6c8eab043fbf66f7137b5bef38a6aef4a7142b37'
At C:\BuildWorker1\_work\1\s\output\RequiredModules\Sampler\0.115.0\tasks\Create_Release_Git_Tag.build.ps1:115 char:21
+ $isCurrentTag = git describe --contains 2> $null
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At C:\BuildWorker1\_work\1\s\output\RequiredModules\Sampler\0.115.0\tasks\Create_Release_Git_Tag.build.ps1:98 char:1
+ task Create_Release_Git_Tag {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Build FAILED. 2 tasks, 1 errors, 0 warnings 00:00:07.9374849
git : fatal: cannot describe '6c8eab043fbf66f7137b5bef38a6aef4a7142b37'
At C:\BuildWorker1\_work\1\s\output\RequiredModules\Sampler\0.115.0\tasks\Create_Release_Git_Tag.build.ps1:115 char:21
+ $isCurrentTag = git describe --contains 2> $null
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (fatal: cannot d...a6aef4a7142b37':String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
##[error]PowerShell exited with code '1'.
Finishing: Publish Release
### How to reproduce
Calling the task as part of the publish workflow:
```yaml
publishAzDo:
- Publish_Module_To_gallery
- Publish_GitHub_Wiki_Content
- Create_Release_Git_Tag
- Create_Changelog_Branch
Expected behavior
No error to be thrown in a new repo.
Current behavior
See above
Suggested solution
Fix is on the way.
Operating system the target node is running
OsName : Microsoft Windows 11 Pro for Workstations
OsOperatingSystemSKU : 161
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 22000.1.amd64fre.co_release.210604-1628
OsLanguage : en-US
OsMuiLanguages : {en-US}
PowerShell version and build the target node is running
Problem description
The new task throws if there is no tag yet defined. The call in
D:\Git\Sampler\.build\tasks\Create_Release_Git_Tag.build.ps1::115
should be in a try-catch block.Verbose logs
Expected behavior
No error to be thrown in a new repo.
Current behavior
See above
Suggested solution
Fix is on the way.
Operating system the target node is running
PowerShell version and build the target node is running
Module version used