File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,12 @@ async function getRepositories(): Promise<string[] | undefined> {
7878 }
7979 } else {
8080 void logger . log ( 'No repository lists defined. Displaying text input box.' ) ;
81- const repoRegex = / ^ (?: [ a - z A - Z 0 - 9 ] + - ? ) * [ a - z A - Z 0 - 9 ] \/ [ a - z A - Z 0 - 9 - _ ] + $ / ;
81+ /**
82+ * This regex matches strings of the form `owner/repo` where:
83+ * - `owner` is made up of alphanumeric characters or single hyphens, starting and ending in an alphanumeric character
84+ * - `repo` is made up of alphanumeric characters, hyphens, or underscores
85+ */
86+ const repoRegex = / ^ (?: [ a - z A - Z 0 - 9 ] + - ) * [ a - z A - Z 0 - 9 ] + \/ [ a - z A - Z 0 - 9 - _ ] + $ / ;
8287 const remoteRepo = await window . showInputBox ( {
8388 title : 'Enter a GitHub repository in the format <owner>/<repo> (e.g. github/codeql)' ,
8489 placeHolder : '<owner>/<repo>' ,
You can’t perform that action at this time.
0 commit comments