Skip to content

Commit 0db0ea0

Browse files
fix review comments
1 parent 510da55 commit 0db0ea0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.ci/scripts/retry.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,20 @@ while [ $attempt -le "$max_retries" ]; do
3333
echo "Command: $command"
3434
echo "Working directory: $(pwd)"
3535

36-
if eval "$command"; then
36+
eval "$command"
37+
exit_code=$?
38+
if [ $exit_code -eq 0 ]; then
3739
echo "Command succeeded on attempt $attempt"
3840
exit 0
3941
fi
4042

41-
exit_code=$?
4243
if [ $attempt -lt "$max_retries" ]; then
4344
echo "Command failed (exit code: $exit_code). Retrying in ${current_delay}s..."
4445
sleep "$current_delay"
4546
current_delay=$((current_delay * 2)) # Exponential backoff
4647
attempt=$((attempt + 1))
4748
else
48-
echo "Command failed after $max_retries attempts"
49+
echo "Command failed after $max_retries attempts with exit code: $exit_code"
4950
exit $exit_code
5051
fi
5152
done

.github/actions/hermit/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ runs:
6666
run: |
6767
max_retries=5
6868
retry_delay=10
69-
./.ci/scripts/retry.sh "$max_retries" "$retry_delay" './bin/hermit env --raw >> "$GITHUB_ENV"'
69+
./.ci/scripts/retry.sh "$max_retries" "$retry_delay" './bin/hermit env --raw' >> "$GITHUB_ENV"
7070
7171
# in case of cache miss, an older instance of cache could be selected (with restore-keys).
7272
# Clean hermit packages to avoid continuously size increment of folder ~/.cache/hermit/pkg.

0 commit comments

Comments
 (0)