From 54b624ccda9b1638af9b9df72a2a2717f3e39bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Tue, 19 Mar 2024 14:56:48 +0100 Subject: [PATCH] Retry GH package upload on error --- R/gh-repo.R | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/R/gh-repo.R b/R/gh-repo.R index 03b703fc..3feef6db 100644 --- a/R/gh-repo.R +++ b/R/gh-repo.R @@ -232,7 +232,13 @@ ghrepo <- local({ ghr$create(slug, ver) } cli::cli_alert_info("Adding release asset for {slug} {ver}.") - ghr$add_asset(slug, inst$built_path[i], ver) + tryCatch( + ghr$add_asset(slug, inst$built_path[i], ver), + error = function(err) { + cli::cli_alert_info("Try adding release asset again.") + ghr$add_asset(slug, inst$built_path[i], ver), + } + ) } }