Skip to content

Commit caf4dd3

Browse files
hudeng-gomyml
authored andcommitted
chore: Add retry for doc check init step
1 parent cdb90bf commit caf4dd3

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/doc-check.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,21 @@ jobs:
4040
echo "deb [trusted=yes] https://ci.deepin.com/repo/obs/deepin:/CI:/topics:/${trimedBranch}/deepin_develop/ ./" >> /etc/apt/sources.list
4141
echo "deb-src [trusted=yes] https://ci.deepin.com/repo/obs/deepin:/CI:/topics:/${trimedBranch}/deepin_develop/ ./" >> /etc/apt/sources.list
4242
fi
43-
apt-get update && apt-get install -y --force-yes ca-certificates apt-transport-https sudo
44-
sudo apt-get install -y --force-yes python3-pip python3-coverxygen
43+
retries=3
44+
for i in $(seq 1 $retries); do
45+
apt-get update && apt-get install -y --force-yes ca-certificates apt-transport-https sudo && sudo apt-get install -y --force-yes python3-pip python3-coverxygen
46+
status=$?
47+
if [ $status -eq 0 ]; then
48+
echo "Init succeeded after $i attempt(s)"
49+
exit 0
50+
fi
51+
if [ $i -lt $retries ]; then
52+
echo "Init failed. Attempt $i of $retries. Retrying in 5 seconds..."
53+
sleep 5
54+
fi
55+
done
56+
echo "Init failed after $retries attempts. Giving up."
57+
exit 1
4558
4659
- uses: actions/checkout@v3
4760
with:

0 commit comments

Comments
 (0)