fix: fix dirname generate in e2e github action (#995)

This commit is contained in:
yoyo 2023-12-01 17:26:52 +08:00 committed by GitHub
parent b8408b4c2b
commit 54f659ca69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -24,7 +24,11 @@ jobs:
const regex = /\[(.*?)\]/
const matches = prTitle.match(regex)
if (matches && matches.length > 1 && matches[1]) {
let components = matches[1].split(',').map(c => c.trim()).filter(c => /^[a-z\-]+$/.test(c)).map(c => `${c}/`)
let components = matches[1]
.split(',')
.map((c) => c.trim())
.filter((c) => /^[a-z\-\/]+$/.test(c))
.map((c) => `"\\/${c}\\/"`)
components = [...new Set(components)].slice(0, 3).join(' ')
core.setOutput('testComponents', components)
} else {