0

When version tag is set on last commit it works ok. But when version tag is set on some of parent commit the resulting version is 0.0.0-alpha.0

raV720
  • 564
  • 3
  • 27

1 Answers1

1

The problem is with the way azure devops does checkout. It fetches only last commit (depth=1). Log from devops checkout:

git --config-env=http.extraheader=env_var_http.extraheader fetch --force --tags --prune --prune-tags --progress --no-recurse-submodules origin --depth=1 .....

and minver cannot infer version from only last commit. The fix is to set appropriate depth in azure-pipelines.yml:

steps:
- checkout: self
  fetchDepth: 50  # the depth of commits to ask Git to fetch
  fetchTags: true

Now log looks good:

git --config-env=http.extraheader=env_var_http.extraheader fetch --force --tags --prune --prune-tags --progress --no-recurse-submodules origin --depth=50

and minver does its job.

Shamrai Aleksander
  • 13,096
  • 3
  • 24
  • 31
raV720
  • 564
  • 3
  • 27