Skip to content

Commit

Permalink
ci: remove routing groups from the paths
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Slartibartfass2 committed Dec 12, 2024
1 parent 0620697 commit f573470
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f573470

Please sign in to comment.