From e786729555c58ce8ab4409e6c0de1780d65d205d Mon Sep 17 00:00:00 2001 From: Paolo Ricciuti Date: Tue, 5 Nov 2024 17:05:21 +0100 Subject: [PATCH] fix: find the right sha for logging (#14159) --- .github/workflows/pkg.pr.new-comment.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pkg.pr.new-comment.yml b/.github/workflows/pkg.pr.new-comment.yml index c3924799d8..1698a456d3 100644 --- a/.github/workflows/pkg.pr.new-comment.yml +++ b/.github/workflows/pkg.pr.new-comment.yml @@ -75,13 +75,17 @@ jobs: } async function log_publish_info() { + const svelte_package = output.packages.find(p => p.name === 'svelte'); + const svelte_sha = svelte_package.url.replace(/^.+@([^@]+)$/, '$1'); console.log('\n' + '='.repeat(50)); console.log('Publish Information'); console.log('='.repeat(50)); console.log('\nPublished Packages:'); - console.log(output.packages.map((p) => `${p.name} - pnpm add https://pkg.pr.new/${p.name}@${number}`).join('\n')); - console.log('\nPlayground URL:'); - console.log(`\nhttps://svelte.dev/playground?version=commit-${output.sha.substring(0, 7)}`) + console.log(output.packages.map((p) => `${p.name} - pnpm add https://pkg.pr.new/${p.name}@${p.url.replace(/^.+@([^@]+)$/, '$1')}`).join('\n')); + if(svelte_sha){ + console.log('\nPlayground URL:'); + console.log(`\nhttps://svelte.dev/playground?version=commit-${svelte_sha}`) + } console.log('\n' + '='.repeat(50)); }