From 770ccfad4e42d92838ca6504a68caa459c22147a Mon Sep 17 00:00:00 2001 From: Pedro Sousa <680496+pedrosousa@users.noreply.github.com> Date: Tue, 29 Apr 2025 12:18:29 +0100 Subject: [PATCH] [Docs] Print URLs even when there's no PR --- bin/post-preview-url-comment/index.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/post-preview-url-comment/index.ts b/bin/post-preview-url-comment/index.ts index 85c4cd4d0c6391..579205d148b37b 100644 --- a/bin/post-preview-url-comment/index.ts +++ b/bin/post-preview-url-comment/index.ts @@ -21,6 +21,15 @@ async function run(): Promise { const ctx = github.context; const branch = ctx.ref.replace("refs/heads/", ""); + const previewUrl = { + branch: `https://${branchToSubdomain(branch)}.preview.developers.cloudflare.com`, + commit: `https://${ctx.sha.slice(0, 8)}.preview.developers.cloudflare.com`, + }; + + core.info( + `Commit URL: ${previewUrl.commit}\nBranch URL: ${previewUrl.branch}`, + ); + core.info(`Finding pull requests for ${ctx.ref}`); const { data: pulls } = await octokit.rest.pulls.list({ @@ -63,15 +72,6 @@ async function run(): Promise { core.info(`No existing comment found`); } - const previewUrl = { - branch: `https://${branchToSubdomain(branch)}.preview.developers.cloudflare.com`, - commit: `https://${ctx.sha.slice(0, 8)}.preview.developers.cloudflare.com`, - }; - - core.info( - `Commit URL: ${previewUrl.commit}\nBranch URL: ${previewUrl.branch}`, - ); - const changedFiles = files .filter( (file) =>