@@ -88,10 +88,22 @@ jobs:
|
88 | 88 | git -C "$GITHUB_WORKSPACE" remote add origin "https://github.com/${CHECKOUT_REPO}.git" |
89 | 89 | fetch_checkout_ref() { |
90 | 90 | local ref="$1" |
91 | | - timeout --signal=TERM --kill-after=10s 30s git -C "$GITHUB_WORKSPACE" \ |
92 | | - -c protocol.version=2 \ |
93 | | - fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \ |
94 | | - "+${ref}:refs/remotes/origin/checkout" |
| 91 | + local fetch_status |
| 92 | + for attempt in 1 2 3; do |
| 93 | + timeout --signal=TERM --kill-after=10s 30s git -C "$GITHUB_WORKSPACE" \ |
| 94 | + -c protocol.version=2 \ |
| 95 | + fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \ |
| 96 | + "+${ref}:refs/remotes/origin/checkout" && return 0 |
| 97 | + fetch_status="$?" |
| 98 | + if [ "$fetch_status" != "124" ] && [ "$fetch_status" != "137" ]; then |
| 99 | + return "$fetch_status" |
| 100 | + fi |
| 101 | + if [ "$attempt" = "3" ]; then |
| 102 | + return "$fetch_status" |
| 103 | + fi |
| 104 | + echo "::warning::checkout fetch for '$ref' timed out on attempt $attempt; retrying" |
| 105 | + sleep 5 |
| 106 | + done |
95 | 107 | } |
96 | 108 | if fetch_checkout_ref "$CHECKOUT_REF"; then |
97 | 109 | : |
@@ -337,10 +349,22 @@ jobs:
|
337 | 349 | git -C "$GITHUB_WORKSPACE" remote add origin "https://github.com/${CHECKOUT_REPO}.git" |
338 | 350 | fetch_checkout_ref() { |
339 | 351 | local ref="$1" |
340 | | - timeout --signal=TERM --kill-after=10s 30s git -C "$GITHUB_WORKSPACE" \ |
341 | | - -c protocol.version=2 \ |
342 | | - fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \ |
343 | | - "+${ref}:refs/remotes/origin/checkout" |
| 352 | + local fetch_status |
| 353 | + for attempt in 1 2 3; do |
| 354 | + timeout --signal=TERM --kill-after=10s 30s git -C "$GITHUB_WORKSPACE" \ |
| 355 | + -c protocol.version=2 \ |
| 356 | + fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \ |
| 357 | + "+${ref}:refs/remotes/origin/checkout" && return 0 |
| 358 | + fetch_status="$?" |
| 359 | + if [ "$fetch_status" != "124" ] && [ "$fetch_status" != "137" ]; then |
| 360 | + return "$fetch_status" |
| 361 | + fi |
| 362 | + if [ "$attempt" = "3" ]; then |
| 363 | + return "$fetch_status" |
| 364 | + fi |
| 365 | + echo "::warning::checkout fetch for '$ref' timed out on attempt $attempt; retrying" |
| 366 | + sleep 5 |
| 367 | + done |
344 | 368 | } |
345 | 369 | if fetch_checkout_ref "$CHECKOUT_REF"; then |
346 | 370 | : |
@@ -1583,10 +1607,25 @@ jobs:
|
1583 | 1607 | git init "$GITHUB_WORKSPACE" |
1584 | 1608 | git -C "$GITHUB_WORKSPACE" config gc.auto 0 |
1585 | 1609 | git -C "$GITHUB_WORKSPACE" remote add origin "https://github.com/${CHECKOUT_REPO}.git" |
1586 | | - timeout --signal=TERM --kill-after=10s 30s git -C "$GITHUB_WORKSPACE" \ |
1587 | | - -c protocol.version=2 \ |
1588 | | - fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \ |
1589 | | - "+${CHECKOUT_SHA}:refs/remotes/origin/checkout" |
| 1610 | + fetch_checkout_ref() { |
| 1611 | + local fetch_status |
| 1612 | + for attempt in 1 2 3; do |
| 1613 | + timeout --signal=TERM --kill-after=10s 30s git -C "$GITHUB_WORKSPACE" \ |
| 1614 | + -c protocol.version=2 \ |
| 1615 | + fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \ |
| 1616 | + "+${CHECKOUT_SHA}:refs/remotes/origin/checkout" && return 0 |
| 1617 | + fetch_status="$?" |
| 1618 | + if [ "$fetch_status" != "124" ] && [ "$fetch_status" != "137" ]; then |
| 1619 | + return "$fetch_status" |
| 1620 | + fi |
| 1621 | + if [ "$attempt" = "3" ]; then |
| 1622 | + return "$fetch_status" |
| 1623 | + fi |
| 1624 | + echo "::warning::checkout fetch for '$CHECKOUT_SHA' timed out on attempt $attempt; retrying" |
| 1625 | + sleep 5 |
| 1626 | + done |
| 1627 | + } |
| 1628 | + fetch_checkout_ref |
1590 | 1629 | git -C "$GITHUB_WORKSPACE" checkout --detach refs/remotes/origin/checkout |
1591 | 1630 | |
1592 | 1631 | - name: Setup Python |
|