-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
32 lines (32 loc) · 853 Bytes
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: 'Repeat Action'
description: 'Repeat given command n times or until succeeds'
inputs:
command:
description: 'Command to execute'
required: true
count:
description: 'Count of repetitions'
required: false
default: 1
outputs:
status:
description: "Exit value of the command (error if no execution was successful)"
value: ${{ steps.repeat.outputs.status }}
runs:
using: "composite"
steps:
- name: Run action
id: repeat
shell: bash
run: |
for i in $(seq 1 ${{ inputs.count }});
do
echo "$i: ${{ inputs.command }}"
{ ${{ inputs.command }} ; status=$?; } || true
echo "$i: status=$status"
if [[ "$status" -eq 0 ]]
then
break
fi
done
echo "statusr=$status" >> $GITHUB_OUTPUT