throw errors when translations fail to fetch during build (#58781)
This commit is contained in:
@@ -19,9 +19,21 @@ clone_or_use_cached_repo() {
|
|||||||
cd "$repo_name"
|
cd "$repo_name"
|
||||||
|
|
||||||
# Fetch latest changes
|
# Fetch latest changes
|
||||||
git fetch origin "$branch"
|
if ! git fetch origin "$branch"; then
|
||||||
git checkout "$branch"
|
echo "❌ Failed to fetch repository '$repo_name'"
|
||||||
git pull origin "$branch"
|
cd ..
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if ! git checkout "$branch"; then
|
||||||
|
echo "❌ Failed to checkout branch '$branch' in repository '$repo_name'"
|
||||||
|
cd ..
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if ! git pull origin "$branch"; then
|
||||||
|
echo "❌ Failed to pull repository '$repo_name'"
|
||||||
|
cd ..
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Updated repository '$repo_name' with the latest changes from $branch."
|
echo "Updated repository '$repo_name' with the latest changes from $branch."
|
||||||
|
|
||||||
@@ -30,7 +42,10 @@ clone_or_use_cached_repo() {
|
|||||||
echo "Cloning repository '$repo_name' from branch '$branch'..."
|
echo "Cloning repository '$repo_name' from branch '$branch'..."
|
||||||
|
|
||||||
# We only need the most recent change for production deploys, so we use --depth 1
|
# We only need the most recent change for production deploys, so we use --depth 1
|
||||||
git clone --depth 1 --branch "$branch" "https://${GITHUB_TOKEN}@github.com/github/$repo_url.git" "$repo_name"
|
if ! git clone --depth 1 --branch "$branch" "https://${GITHUB_TOKEN}@github.com/github/$repo_url.git" "$repo_name"; then
|
||||||
|
echo "❌ Failed to clone repository '$repo_name'"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Repository '$repo_name' is up to date."
|
echo "Repository '$repo_name' is up to date."
|
||||||
|
|||||||
Reference in New Issue
Block a user