From fc9b28a7b63ff6773ce3ef54e2cba4a09196e767 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Mon, 31 Mar 2025 16:16:23 -0400 Subject: [PATCH] publish - timeout after 5 minutes. Closes #12286 --- src/publish/gh-pages/gh-pages.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/publish/gh-pages/gh-pages.ts b/src/publish/gh-pages/gh-pages.ts index 39aa0c75be7..3644aa22794 100644 --- a/src/publish/gh-pages/gh-pages.ts +++ b/src/publish/gh-pages/gh-pages.ts @@ -246,6 +246,8 @@ async function publish( // wait for deployment if we are opening a browser let verified = false; + const start = new Date(); + if (options.browser && ghContext.siteUrl && !notifyGhPagesBranch) { await withSpinner({ message: @@ -253,6 +255,14 @@ async function publish( }, async () => { const noJekyllUrl = joinUrl(ghContext.siteUrl!, ".nojekyll"); while (true) { + const now = new Date(); + const elapsed = now.getTime() - start.getTime(); + if (elapsed > 1000 * 60 * 5) { + info(colors.yellow( + "Deployment took longer than 5 minutes, giving up waiting for deployment to complete", + )); + break; + } await sleep(2000); const response = await fetch(noJekyllUrl); if (response.status === 200) {