From 4ccfb857a42b063482b9c0afece8cc9df422e4af Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Tue, 31 Jan 2023 16:03:37 +0100 Subject: [PATCH] ci: add retry to gh install [skip ci] --- install_gh.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install_gh.sh b/install_gh.sh index a829ada..05c75b1 100755 --- a/install_gh.sh +++ b/install_gh.sh @@ -1,12 +1,12 @@ #!/bin/bash -set -e +set -ex GH_ARCH="amd64" -VERSION=`curl "https://api.github.com/repos/cli/cli/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/' | cut -c2-` +VERSION=`curl --retry 12 --retry-delay 30 --retry-all-errors "https://api.github.com/repos/cli/cli/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/' | cut -c2-` -curl -sSL "https://github.com/cli/cli/releases/download/v${VERSION}/gh_${VERSION}_linux_${GH_ARCH}.tar.gz" -o "gh_${VERSION}_linux_${GH_ARCH}.tar.gz" +curl --retry 12 --retry-delay 120 --retry-all-errors -sSL "https://github.com/cli/cli/releases/download/v${VERSION}/gh_${VERSION}_linux_${GH_ARCH}.tar.gz" -o "gh_${VERSION}_linux_${GH_ARCH}.tar.gz" tar xf "gh_${VERSION}_linux_${GH_ARCH}.tar.gz"