Skip to content

Commit 43e330a

Browse files
authored
[CI] Add smart-checkout/action.yml file on main branch (#418)
* add smart-checkout/action.yml file * fix: remove trailing whitespace and extra newline * add a new line at end * modified smart-checkout/action.yml * modified smart-checkout/action.yml file to be true
1 parent 1beb3f8 commit 43e330a

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: 'Smart Checkout with Retry'
2+
description: 'Attempts to checkout code with multiple retries and sleep intervals'
3+
inputs:
4+
checkout_version:
5+
description: 'The version of actions/checkout to use'
6+
required: false
7+
default: 'v6'
8+
9+
runs:
10+
using: 'composite'
11+
steps:
12+
- name: Checkout code (attempt 1)
13+
id: checkout1
14+
uses: actions/checkout@v6
15+
with:
16+
fetch-depth: 0
17+
continue-on-error: true
18+
19+
- name: Sleep before checkout2
20+
if: steps.checkout1.outcome == 'failure'
21+
shell: bash
22+
run: |
23+
echo "First checkout attempt failed. Sleeping for 120 seconds before retry..."
24+
sleep 120
25+
26+
- name: Checkout code (attempt 2)
27+
id: checkout2
28+
if: steps.checkout1.outcome == 'failure'
29+
uses: actions/checkout@v6
30+
with:
31+
fetch-depth: 0
32+
continue-on-error: true
33+
34+
- name: Sleep before final checkout
35+
if: steps.checkout1.outcome == 'failure' && steps.checkout2.outcome == 'failure'
36+
shell: bash
37+
run: |
38+
echo "Second checkout attempt failed. Sleeping for 180 seconds before final retry..."
39+
sleep 180
40+
41+
- name: Checkout code (final attempt)
42+
if: steps.checkout1.outcome == 'failure' && steps.checkout2.outcome == 'failure'
43+
uses: actions/checkout@v6
44+
with:
45+
fetch-depth: 0
46+
47+
- name: Verify checkout success
48+
shell: bash
49+
if: success()
50+
run: echo "Checkout completed successfully"

0 commit comments

Comments
 (0)