I'm trying to automate test release notes to testers in Testflight.
Xcode Cloud has a feature where it picks up text from a file called WhatToTest.[LOCALE].text.
I want to write to this file all commits since the last tag but for some reason it keeps failing.
The shell script responsible for the file writing looks like this and it works when I run it locally. But when it runs in Xcode Cloud the logs contain an error message.
fatal: No tags can describe '2a802f39e0e4e1d1541244294be47deb4f40e182'.
Try --always, or create some tags.
last tag:
#!/bin/sh
lastTag=$(git fetch --tags -q && git describe --tags --abbrev=0)
echo "last tag: $lastTag"
git fetch --tags && git log --pretty=format:"%s" "$lastTag..HEAD" > "$CI_WORKSPACE/TestFlight/WhatToTest.en-US.txt"
Any ideas?
In Xcode cloud
, the depth is only 1 when fetch, so if you wanna get lasted tag or history, you can execute this command first, then do what you want. git fetch --depth 1000
.
Of coarse, the number of depth 1000 you can change to any other number.