I have an issue reading the tags of a git repository during the CI automated workflow. I do not want to create a full-clone as this incurs extensive overhead so would prefer to maintain a 'shallow clone' but somehow determine the tag for application versioning.
Use Case
- Github Actions CI build checks out the Git-Repository as a 'shallow' clone by setting
git clone ... --depth=1. - The pre-build stage performs
git describe --tagsto embed version-information into the compiled application
Expected outcome
With full-clone the tag would be reported as follows:
> git describe --tags
v0.5.0-95-g7bbc323
Actual outcome
The shallow-clone under CI does not work the same:
> git describe --tags
fatal: No names found, cannot describe anything.
Solution Ideas
- Modify the 'clone' under the CI to include tags somehow?
- Modify the pre-build 'desribe' step to read the tags from the remote if this were possible?