fix(editor): Update git repo url validation regex (#7151)

This commit is contained in:
Csaba Tuncsik
2023-09-11 20:54:03 +02:00
committed by GitHub
parent fd800b674b
commit e51f173608
2 changed files with 47 additions and 1 deletions

View File

@@ -122,7 +122,8 @@ const repoUrlValidationRules: Array<Rule | RuleGroup> = [
{
name: 'MATCH_REGEX',
config: {
regex: /^(?!https?:\/\/)(?:git|ssh|git@[-\w.]+):(\/\/)?(.*?)(\.git)(\/?|\#[-\d\w._]+?)$/,
regex:
/^git@(?:\[[0-9a-fA-F:]+\]|(?:[a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+)(?::[0-9]+)*:(?:v[0-9]+\/)?[a-zA-Z0-9_.\-\/]+(\.git)?(?:\/[a-zA-Z0-9_.\-\/]+)*$/,
message: locale.baseText('settings.sourceControl.repoUrlInvalid'),
},
},