We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 20b97d2 commit 0c512faCopy full SHA for 0c512fa
.github/workflows/workflow.yml
@@ -25,7 +25,7 @@ jobs:
25
run: sudo apt-get update && sudo apt-get install snapd sqlite3
26
27
- name: Install newsboat
28
- run: sudo snap install newsboat
+ run: source ./scripts/retry.sh && with_retry 5 sudo snap install newsboat
29
30
- name: Fetch liveboat
31
run: |
scripts/retry.sh
@@ -0,0 +1,17 @@
1
+#!/bin/bash
2
+
3
+with_retry() {
4
+ local -r -i max_attempts="$1"; shift
5
+ local -i attempt_num=1
6
+ until "$@"
7
+ do
8
+ if ((attempt_num==max_attempts))
9
+ then
10
+ echo "Attempt $attempt_num failed and there are no more attempts left!"
11
+ return 1
12
+ else
13
+ echo "Attempt $attempt_num failed! Trying again in $attempt_num seconds..."
14
+ sleep $((attempt_num++))
15
+ fi
16
+ done
17
+}
0 commit comments