Skip to content

Commit 17e7691

Browse files
committed
script better error handling
1 parent 855a520 commit 17e7691

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

scripts/setup_quickstart_spm.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,13 @@ update_spm_dependency() {
149149
"${NIGHTLY_RELEASE_TESTING}")
150150
# For release testing, find the latest CocoaPods tag.
151151
local latest_tag
152-
latest_tag=$(git -C "$root_dir" tag -l "CocoaPods-*" --sort=-v:refname | \
153-
grep -E '^CocoaPods-[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1)
152+
latest_tag=$(git -C "$root_dir" tag -l "CocoaPods-*" --sort=-v:refname |
153+
awk '/^CocoaPods-[0-9]+\.[0-9]+\.[0-9]+$/{print; exit}')
154154
if [[ -z "$latest_tag" ]]; then
155-
echo "Error: Could not find a 'CocoaPods-X.Y.Z' tag." >&2
155+
echo "Error: Could not find the latest CocoaPods tag." >&2
156+
echo "This is often caused by a shallow git clone in a CI environment." >&2
157+
echo "If you are running in GitHub Actions, please ensure your checkout" >&2
158+
echo "step includes 'fetch-depth: 0' to fetch the full git history." >&2
156159
exit 1
157160
fi
158161
local tag_revision

0 commit comments

Comments
 (0)