You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched issues to ensure it has not already been reported
Cake runner
Cake .NET Tool
Cake version
5.12.0
Operating system
Windows
Operating system architecture
64-Bit
CI Server
Github actions
What are you seeing?
Gitversion needs to have history to calculate the version. The default for the checkout task in github actions is sparse checkout, only a single commit (the latest) is pulled down. This causes the cake gitversion code to crash.
Without any diagnostics the error message does not point to the problem at hand.
Enabling diagnostic verbosity, one can see where it crashes, and since I have made this mistake in other builds earlier I recognized the pattern (red line indicates it). Others may not be that lucky.
If you run the gitversion tool as a separate step in the action, it will give you more information, and will not crash, but you get of course a meaningless version number.
The gitversion code in cake should detect this situation and try to give a more meaningful error message.
What is expected?
A message like: Not able to calculate gitversion
And since this is Gitversion, it could suggest something like Do you have a shallow clone?
Prerequisites
Cake runner
Cake .NET Tool
Cake version
5.12.0
Operating system
Windows
Operating system architecture
64-Bit
CI Server
Github actions
What are you seeing?
Gitversion needs to have history to calculate the version. The default for the checkout task in github actions is sparse checkout, only a single commit (the latest) is pulled down. This causes the cake gitversion code to crash.
Without any diagnostics the error message does not point to the problem at hand.
Enabling diagnostic verbosity, one can see where it crashes, and since I have made this mistake in other builds earlier I recognized the pattern (red line indicates it). Others may not be that lucky.
If you run the gitversion tool as a separate step in the action, it will give you more information, and will not crash, but you get of course a meaningless version number.
The gitversion code in cake should detect this situation and try to give a more meaningful error message.
What is expected?
A message like:
Not able to calculate gitversion
And since this is Gitversion, it could suggest something like
Do you have a shallow clone?
Steps to Reproduce
Fork the repo https://github.com/nunit/nunit-console/
Select branch: https://github.com/nunit/nunit-console/tree/githubbuilds
The issue is fixed there now, but go down to commit
72062fc
and build from that one.To prevent the issue from appearing, make sure the checkout action looks like this:
Output log
See builds in nunit/nunit-console#1396, for commits
924fbc8
or laterThe text was updated successfully, but these errors were encountered: