diff --git a/bin/post-preview-url-comment/index.ts b/bin/post-preview-url-comment/index.ts index 85c4cd4d0c63917..579205d148b37be 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) =>