From 530701b8508dadef065fed70b4c8d0e298d1baf1 Mon Sep 17 00:00:00 2001 From: Felix Schlegel Date: Mon, 9 Dec 2024 10:26:28 +0100 Subject: [PATCH] ci: remove routing groups from the paths Groups are only virtual i.e. won't be in the path of the URL in the end. They're only used to group pages, and need to be removed from the generated URLs. --- .github/workflows/lighthouse.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lighthouse.yml b/.github/workflows/lighthouse.yml index ec95147..8311e3b 100644 --- a/.github/workflows/lighthouse.yml +++ b/.github/workflows/lighthouse.yml @@ -37,10 +37,11 @@ jobs: const globber = await glob.create('**/src/routes/**/+page.svelte'); const files = await globber.glob(); const urls = files - .map(x => x.match(/routes\/([a-zA-Z\/\[\]]*?)\/?\+page\.svelte/)[1]) - .map(x => x.replace('[paperId]', '42').replace('[projectId]', '12')) + .map(x => x.match(/routes\/([\(a-zA-Z\/\[\]\)]*?)\/?\+page\.svelte/)[1]) + .map(x => x.replace('[paperId]', '42').replace('[projectId]', '12').replace(/\([a-z\-]+\)\//g, '')) .map(x => `http://localhost:8080/${x}`) .join('\n'); + console.log('generated URLs:', urls); core.setOutput('urls', urls); # Add '& echo ...' to run command in background