Closed dazinator closed 7 months ago
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs.
This issue was closed because it has been stalled for 30 days with no activity. Thank you for your contributions
A pull request documenting this would be merged in an instant. 🙏🏼
I think The AzureDevops task should point instead to https://github.com/GitTools/actions/tree/main/docs/examples/azure as there we have the examples and docs
Closing in favor of https://github.com/GitTools/GitVersion/issues/3937
I get this problem even with fetchDepth: 0
setting. The problem occurs every time I start a pipeline run. When I re-run the job (Re-run failed tasks), it goes well.
steps:
- checkout: self
clean: true
fetchDepth: 0
fetchTags: true
submodules: recursive
I also have this problem @mc0re - did you find a solution? It seems like every couple of years, Microsoft VSTS/AzureDevOps finds a way to break this feature. It broke in 2018 and 2022, and now 2024.
@jzabroski In my case the issue was in using on-site agents and not cleaning them. There's a file in .git
directory that tells Git it's working in shallow mode. The file is created by later jobs, using shallow checkout. Delete it after the checkout step - and it works.
I'm afraid I can't recall the exact name of the file and I cannot look it up now, but it was obvious from the name.
For Azure devops build pipelines created later than a certain date, they started doing shallow clone's and subsequently this means the following gitversion
AzDO
tasks fail.There is a gitversion docs page for configuring the different build servers but nothing about this for azure devops that I could see.
The important piece of info is here: https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/steps-checkout?view=azure-pipelines#shallow-fetch
It basically boils down to this, you need to add an intial
checkout
task to your yaml pipeline to control checkout behaviour and explicit set fetch depth to 0 (which means it won't do shallow fetch).