File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,11 @@ function extractOrgFromUrl(url: string): { organization: string } {
83
83
match = url . match ( / h t t p s ? : \/ \/ ( [ ^ . ] + ) \. v i s u a l s t u d i o \. c o m / ) ;
84
84
}
85
85
86
+ // Fallback: capture the first path segment for any URL
87
+ if ( ! match ) {
88
+ match = url . match ( / h t t p s ? : \/ \/ [ ^ / ] + \/ ( [ ^ / ] + ) / ) ;
89
+ }
90
+
86
91
const organization = match ? match [ 1 ] : '' ;
87
92
88
93
if ( ! organization ) {
Original file line number Diff line number Diff line change @@ -11,8 +11,16 @@ dotenv.config();
11
11
*/
12
12
export function getOrgNameFromUrl ( url ?: string ) : string {
13
13
if ( ! url ) return 'unknown-organization' ;
14
- const match = url . match ( / h t t p s ? : \/ \/ d e v \. a z u r e \. c o m \/ ( [ ^ / ] + ) / ) ;
15
- return match ? match [ 1 ] : 'unknown-organization' ;
14
+ const devMatch = url . match ( / h t t p s ? : \/ \/ d e v \. a z u r e \. c o m \/ ( [ ^ / ] + ) / ) ;
15
+ if ( devMatch ) {
16
+ return devMatch [ 1 ] ;
17
+ }
18
+ // Fallback only for Azure DevOps Server URLs
19
+ if ( url . includes ( 'azure' ) ) {
20
+ const fallbackMatch = url . match ( / h t t p s ? : \/ \/ [ ^ / ] + \/ ( [ ^ / ] + ) / ) ;
21
+ return fallbackMatch ? fallbackMatch [ 1 ] : 'unknown-organization' ;
22
+ }
23
+ return 'unknown-organization' ;
16
24
}
17
25
18
26
/**
You can’t perform that action at this time.
0 commit comments