-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running build with Nuke 6.2.1 (and 6.1.2) in an Github action on ubuntu-latest fails getting git version information: Could not inject value for "Build.GitVersion" #1008
Comments
You have a shallow clone of the repository. Would also appreciate a star on the project 👍 |
@matkoch , thanks for the quick reply. I'm using attributes inheriting from Nuke's GitHubActionsAttribute to generate my Github actions, and noticed that when I upgraded to Nuke 6.2.1 my actions got modified by Nuke to use actions/checkout@v2. So I think the issue is caused by a behavioral change in actions/checkout between version 1 and 2. But how can I force Nuke 6.2.1 to use actions/checkout@1 or to add some extra parameters to force actions/checkout@v2 to not use a shallow clone? |
It's always good to check out what I'm doing in the build script: https://github.com/nuke-build/nuke/blob/develop/build/Build.CI.GitHubActions.cs#L14 Yes, GitHub changed the behavior there... I'm also not a big fan of that. |
Yepp, adding FetchDepth = 0 to all my Github action attributes made them work again after upgrading from Nuke 6.0.3 to 6.2.1 👍 |
See here for the same solution for Bitbucket Pipelines: #944 (comment) |
Usage Information
NUKE v 6.2.1 .Net 6.0.400 Github action on ubuntu-latest
Description
After upgrading Nuke.Common from 6.0.3 to 6.2.1 everything worked fine locally on my Windows machine. When I tried to make a Github PR that runs an action on ubuntu-latest the action failed because the call to gitversion.dll that injects value for "Build.GitVersion" fails, and writes this warning to the log
I tried to upgrade GitVersion.Tool from 5.8.0 to 5.10.3, but still get the same behavior
Reproduction Steps
I must admit that I don't know how easy this is to reproduce, since I experience this in a Github repo with an action running a build with .Net 6.0.400 on ubuntu-latest. It seems like this happens in the intialization of the build before any of my own targets
Maybe its easier if you look at my build project to see how you can reproduce this?
https://github.com/ebjornset/DryGen/tree/main/build
Expected Behavior
[INF] > /home/runner/.dotnet/dotnet /home/runner/.nuget/packages/gitversion.tool/5.10.3/tools/net5.0/any/gitversion.dll /nocache injects "Build.GitVersion" ok.
https://github.com/ebjornset/DryGen/runs/8170096546?check_suite_focus=true
Actual Behavior
[INF] > /home/runner/.dotnet/dotnet /home/runner/.nuget/packages/gitversion.tool/5.10.3/tools/net5.0/any/gitversion.dll /nocache
Warning: Could not inject value for "Build.GitVersion"
Nuke 6.2.1 and GitVersion.Tool 5.10.3:
https://github.com/ebjornset/DryGen/actions/runs/2984614477
Nuke 6.2.1 and GitVersion.Tool 5.8.0:
https://github.com/ebjornset/DryGen/actions/runs/2984639947
Regression?
This worked ok in Nuke 6.0.3, both with GitVersion.Tool 5.8.0 and GitVersion.Tool 5.10.3
Nuke 6.0.3 and GitVersion.Tool 5.10.3:
https://github.com/ebjornset/DryGen/runs/8170046061?check_suite_focus=true
Nuke 6.0.3 and GitVersion.Tool 5.8.0:
https://github.com/ebjornset/DryGen/runs/8163473043?check_suite_focus=true
Known Workarounds
Continue to use Nuke 6.0.3
The text was updated successfully, but these errors were encountered: