'Fastlane - use current git tag as version number

I'm trying to use the latest tag on a branch as the version number in an iOS project, using Fastlane.

If I run git describe --abbrev=0 --tags in my terminal I can see the latest tag output.

I'd like to pipe this value into increment_version_number in Fastlane.

To test this I have run -

fastlane action increment_version_number(version_number: $(git describe --abbrev=0 --tags))

in my terminal, but the output I get is

zsh: unknown file attribute: v

increment_version_number docs

Is it possible to do this?

Thanks



Solution 1:[1]

Running the command in the terminal has a different syntax - you need to supply the arguments inline.

fastlane run increment_version_number version_number:$(git describe --abbrev=0 --tags)"

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 nodediggity