Skip to content

Commit f3ac4e5

Browse files
committed
Fix git pull --rebase failure handling in retry loops
The retry loop used unguarded `git pull --rebase` which, when failed, would abort the entire script due to `set -euo pipefail`, preventing the final diagnostic message from being displayed. Changes: - Wrap `git pull --rebase origin data` in conditional to guard failures - Allow retry loop to continue even if pull/rebase fails - Ensure final "Failed to push after $max_attempts attempts" message is always displayed - Maintain proper exit code (1) after all attempts are exhausted Pattern applied to all 12 workflow files with push retry loops.
1 parent 92b825d commit f3ac4e5

13 files changed

Lines changed: 39 additions & 13 deletions

.github/workflows/data-update-base-files-info.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ jobs:
6666
6767
# Pull with rebase to resolve conflicts
6868
echo "Push failed, attempting to pull and rebase..." >&2
69-
git pull --rebase origin data
69+
if ! git pull --rebase origin data; then
70+
echo "Pull/rebase failed, will retry push..." >&2
71+
fi
7072
7173
attempt=$((attempt + 1))
7274
done

.github/workflows/data-update-download-index.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ jobs:
134134
135135
# Pull with rebase to resolve conflicts
136136
echo "Push failed, attempting to pull and rebase..." >&2
137-
git pull --rebase origin data
137+
if ! git pull --rebase origin data; then
138+
echo "Pull/rebase failed, will retry push..." >&2
139+
fi
138140
139141
attempt=$((attempt + 1))
140142
done

.github/workflows/data-update-image-info.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ jobs:
7676
7777
# Pull with rebase to resolve conflicts
7878
echo "Push failed, attempting to pull and rebase..." >&2
79-
git pull --rebase origin data
79+
if ! git pull --rebase origin data; then
80+
echo "Pull/rebase failed, will retry push..." >&2
81+
fi
8082
8183
attempt=$((attempt + 1))
8284
done

.github/workflows/data-update-jira-excerpt.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ jobs:
179179
180180
# Pull with rebase to resolve conflicts
181181
echo "Push failed, attempting to pull and rebase..." >&2
182-
git pull --rebase origin data
182+
if ! git pull --rebase origin data; then
183+
echo "Pull/rebase failed, will retry push..." >&2
184+
fi
183185
184186
attempt=$((attempt + 1))
185187
done

.github/workflows/data-update-partners-data.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ jobs:
173173
174174
# Pull with rebase to resolve conflicts
175175
echo "Push failed, attempting to pull and rebase..." >&2
176-
git pull --rebase origin data
176+
if ! git pull --rebase origin data; then
177+
echo "Pull/rebase failed, will retry push..." >&2
178+
fi
177179
178180
attempt=$((attempt + 1))
179181
done

.github/workflows/generate-actions-report.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ jobs:
146146
147147
# Pull with rebase to resolve conflicts
148148
echo "Push failed, attempting to pull and rebase..." >&2
149-
git pull --rebase origin data
149+
if ! git pull --rebase origin data; then
150+
echo "Pull/rebase failed, will retry push..." >&2
151+
fi
150152
151153
attempt=$((attempt + 1))
152154
done

.github/workflows/generate-build-lists.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ jobs:
114114
115115
# Pull with rebase to resolve conflicts
116116
echo "Push failed, attempting to pull and rebase..." >&2
117-
git pull --rebase origin data
117+
if ! git pull --rebase origin data; then
118+
echo "Pull/rebase failed, will retry push..." >&2
119+
fi
118120
119121
attempt=$((attempt + 1))
120122
done

.github/workflows/generate-keyring-data.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ jobs:
160160
161161
# Pull with rebase to resolve conflicts
162162
echo "Push failed, attempting to pull and rebase..." >&2
163-
git pull --rebase origin data
163+
if ! git pull --rebase origin data; then
164+
echo "Pull/rebase failed, will retry push..." >&2
165+
fi
164166
165167
attempt=$((attempt + 1))
166168
done

.github/workflows/generate-motd.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ jobs:
6262
6363
# Pull with rebase to resolve conflicts
6464
echo "Push failed, attempting to pull and rebase..." >&2
65-
git pull --rebase origin data
65+
if ! git pull --rebase origin data; then
66+
echo "Pull/rebase failed, will retry push..." >&2
67+
fi
6668
6769
attempt=$((attempt + 1))
6870
done

.github/workflows/generate-servers-jsons.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ jobs:
157157
158158
# Pull with rebase to resolve conflicts
159159
echo "Push failed, attempting to pull and rebase..." >&2
160-
git pull --rebase origin data
160+
if ! git pull --rebase origin data; then
161+
echo "Pull/rebase failed, will retry push..." >&2
162+
fi
161163
162164
attempt=$((attempt + 1))
163165
done

0 commit comments

Comments
 (0)