diff --git a/action.yml b/action.yml index 582d5a4..b683b92 100644 --- a/action.yml +++ b/action.yml @@ -17,7 +17,11 @@ runs: *) echo "better-setup-go: unsupported arch $(uname -m)" >&2; exit 1 ;; esac rm -rf /usr/local/go # a base-image GOROOT under the same path corrupts on overlay - curl -fsSL "https://go.dev/dl/go${v}.linux-${arch}.tar.gz" | tar -xz -C /usr/local + # download-to-file with retries: a piped stream that truncates mid-archive leaves a + # half-extracted GOROOT that fails far away from its cause + curl --retry 3 --retry-delay 2 -fsSL -o /tmp/go.tgz "https://go.dev/dl/go${v}.linux-${arch}.tar.gz" + tar -xzf /tmp/go.tgz -C /usr/local + rm -f /tmp/go.tgz ln -sf /usr/local/go/bin/go /usr/local/bin/go ln -sf /usr/local/go/bin/gofmt /usr/local/bin/gofmt go version