File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
src/deployments/production/build-scripts Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,21 @@ clone_or_use_cached_repo() {
1919 cd " $repo_name "
2020
2121 # Fetch latest changes
22- git fetch origin " $branch "
23- git checkout " $branch "
24- git pull origin " $branch "
22+ if ! git fetch origin " $branch " ; then
23+ echo " ❌ Failed to fetch repository '$repo_name '"
24+ cd ..
25+ return 1
26+ fi
27+ if ! git checkout " $branch " ; then
28+ echo " ❌ Failed to checkout branch '$branch ' in repository '$repo_name '"
29+ cd ..
30+ return 1
31+ fi
32+ if ! git pull origin " $branch " ; then
33+ echo " ❌ Failed to pull repository '$repo_name '"
34+ cd ..
35+ return 1
36+ fi
2537
2638 echo " Updated repository '$repo_name ' with the latest changes from $branch ."
2739
@@ -30,7 +42,10 @@ clone_or_use_cached_repo() {
3042 echo " Cloning repository '$repo_name ' from branch '$branch '..."
3143
3244 # We only need the most recent change for production deploys, so we use --depth 1
33- git clone --depth 1 --branch " $branch " " https://${GITHUB_TOKEN} @github.com/github/$repo_url .git" " $repo_name "
45+ if ! git clone --depth 1 --branch " $branch " " https://${GITHUB_TOKEN} @github.com/github/$repo_url .git" " $repo_name " ; then
46+ echo " ❌ Failed to clone repository '$repo_name '"
47+ return 1
48+ fi
3449 fi
3550
3651 echo " Repository '$repo_name ' is up to date."
You can’t perform that action at this time.
0 commit comments