Git repo does not contain tags

Hello,
I have an issue similar to Cannot get tag when cloning repository for iOS.

I’m using a build process for Android which uses the most recent tag to determine the build number. So when the build runs it should be able to access the tags in the git repo to work correctly.

When the build is triggered by a tag push/creation, the tag is available to the build script and it works correctly. However when the build is triggered by a push or a pull request, no tags are available and it doesn’t work correctly.

Is there a way to force the git clone step to always include tags?

Hi, sorry for the inconvenience, you can find a workaround here: https://github.com/bitrise-io/steps-git-clone/issues/78#issuecomment-375337498

The fix for this is scheduled.

1 Like

I’d say that what I described at https://github.com/bitrise-io/steps-git-clone/issues/78#issuecomment-375337498 is not just a workaround, that’s a proper long term solution. If you need tags you should make sure you fetch them - which can be done with a Script step, with just:

#!/usr/bin/env bash
set -ex

git fetch --tags

This ensures that tags are fetched, no surprises :wink:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.