@@ -105,14 +105,16 @@ export function extractLatestVersionFromTitle(title: string): string | undefined
105105 return latestMatch [ 1 ] ;
106106 }
107107
108- // Try FYI format: "FYI: package X.Y.Z is available"
109- const fyiMatch = title . match ( / F Y I : \s + \S + \s + ( \d + \. \d + \. \d + (?: - [ \w . ] + ) ? ) \s + i s a v a i l a b l e / ) ;
108+ // Try FYI format: "FYI: package <version> is available"
109+ // Anchor on "is available" to be version-format-agnostic (handles semver, calver, etc.)
110+ const fyiMatch = title . match ( / F Y I : \s + \S + \s + ( \S + ) \s + i s a v a i l a b l e / ) ;
110111 if ( fyiMatch ) {
111112 return fyiMatch [ 1 ] ;
112113 }
113114
114- // Try format "to X.Y.Z" (when min === latest)
115- const toMatch = title . match ( / t o \s + ( \d + \. \d + \. \d + (?: - [ \w . ] + ) ? ) \s * $ / ) ;
115+ // Try format "to <version>" (when min === latest)
116+ // Anchor on end-of-string to be version-format-agnostic
117+ const toMatch = title . match ( / t o \s + ( \S + ) \s * $ / ) ;
116118 if ( toMatch ) {
117119 return toMatch [ 1 ] ;
118120 }
@@ -133,8 +135,11 @@ export function extractDependencyNameFromTitle(title: string): string | undefine
133135 return `${ ecoUpdateMatch [ 1 ] } ::${ ecoUpdateMatch [ 2 ] } ` ;
134136 }
135137
136- // Try new FYI format with ecosystem tag: "[Dependicus] [npm] FYI: X Y.Z is available"
137- const ecoFyiMatch = title . match ( / ^ \[ D e p e n d i c u s \] \s + \[ ( \w + ) \] \s + F Y I : \s + ( .+ ?) \s + \d + \. \d + / ) ;
138+ // Try new FYI format with ecosystem tag: "[Dependicus] [eco] FYI: X <version> is available"
139+ // Anchor on "is available" to be version-format-agnostic (handles semver, calver, etc.)
140+ const ecoFyiMatch = title . match (
141+ / ^ \[ D e p e n d i c u s \] \s + \[ ( \w + ) \] \s + F Y I : \s + ( .+ ?) \s + \S + \s + i s a v a i l a b l e / ,
142+ ) ;
138143 if ( ecoFyiMatch ) {
139144 return `${ ecoFyiMatch [ 1 ] } ::${ ecoFyiMatch [ 2 ] } ` ;
140145 }
@@ -146,7 +151,7 @@ export function extractDependencyNameFromTitle(title: string): string | undefine
146151 }
147152
148153 // Backward compat: FYI format (no ecosystem tag)
149- const fyiMatch = title . match ( / ^ \[ D e p e n d i c u s \] \s + F Y I : \s + ( .+ ?) \s + \d + \. \d + / ) ;
154+ const fyiMatch = title . match ( / ^ \[ D e p e n d i c u s \] \s + F Y I : \s + ( .+ ?) \s + \S + \s + i s a v a i l a b l e / ) ;
150155 if ( fyiMatch ) {
151156 return fyiMatch [ 1 ] ;
152157 }
0 commit comments