Skip to content

Commit 2b4141d

Browse files
committed
Fix url parsing
1 parent e3b5878 commit 2b4141d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/auto-labeller.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ jobs:
8989
// Try to extract domain from link first
9090
let domain = '';
9191
if (componentLink) {
92-
const linkMatch = componentLink.match(/\/components\/([^\/]+)/);
92+
// Handle both /components/sensor/bme68x_bsec2.html and /components/bme68x_bsec2.html patterns
93+
// Extract the last segment before .html or the last segment in the path
94+
const linkMatch = componentLink.match(/\/components\/(?:[^\/]+\/)?([^\/]+?)(?:\.html)?(?:[#?].*)?$/);
9395
if (linkMatch) {
9496
domain = linkMatch[1];
9597
if (components.includes(domain)) {

0 commit comments

Comments
 (0)