Skip to content

Commit 0658c32

Browse files
authored
Merge pull request #3 from mageddo-projects/upload-retry
Upload retry
2 parents c4d0c89 + b4d228b commit 0658c32

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

github-cli.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ upload_file(){
3737
local OUT=$(curl --data-binary "@$SOURCE_FILE" -w "\n%{http_code}\n%{stdout}\n" \
3838
-s -X POST -H 'Content-Type: application/octet-stream' \
3939
-H "Authorization: token ${REPO_TOKEN}" \
40-
"https://uploads.github.com/repos/${USERNAME}/${REPOSITORY}/releases/$RELEASE_ID/assets?name=$TARGET_FILE"
40+
"https://uplxxoads.github.com/repos/${USERNAME}/${REPOSITORY}/releases/$RELEASE_ID/assets?name=$TARGET_FILE"
4141
)
4242

4343
if test "$(echo "$OUT" | tail -n 1)" -ne "201"; then
4444
echo -e "> Can't upload file: $TARGET_FILE \n $(echo ${OUT})" >&2
45-
exit 11
45+
return 11
4646
fi
47+
return 0
4748
}
4849

4950
upload_files(){
@@ -52,7 +53,7 @@ upload_files(){
5253
TARGET_FILE="$(basename $SOURCE_FILE)"
5354
echo "> uploading $TARGET_FILE" >&2
5455
md5sum $SOURCE_FILE && ls -lha $SOURCE_FILE
55-
upload_file
56+
upload_file || echo "try 2" && upload_file || echo "try 3" && upload_file
5657
fi
5758
done
5859
}

0 commit comments

Comments
 (0)