Skip to content

Commit

Permalink
Adjust retry on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 17, 2023
1 parent 1df3eee commit 7796885
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ IFS=$'\n\t'
# https://github.com/taiki-e/parse-changelog/releases
parse_changelog_version="0.5.2"

retry() {
for i in {1..10}; do
if "$@"; then
return 0
else
sleep "${i}"
fi
done
"$@"
}
bail() {
echo "::error::$*"
exit 1
Expand Down Expand Up @@ -97,7 +107,7 @@ if [[ -n "${changelog}" ]]; then
*) bail "unrecognized OSTYPE '${OSTYPE}'" ;;
esac
# https://github.com/taiki-e/parse-changelog
curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "https://github.com/taiki-e/parse-changelog/releases/download/v${parse_changelog_version}/parse-changelog-${parse_changelog_target}.tar.gz" \
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "https://github.com/taiki-e/parse-changelog/releases/download/v${parse_changelog_version}/parse-changelog-${parse_changelog_target}.tar.gz" \
| "${tar}" xzf -
parse_changelog_options+=("${changelog}" "${version}")
notes=$(./parse-changelog "${parse_changelog_options[@]}")
Expand Down

0 comments on commit 7796885

Please sign in to comment.