diff --git a/packages/editor-ui/src/views/SettingsSourceControl.vue b/packages/editor-ui/src/views/SettingsSourceControl.vue index 1307da7952..5e310142bd 100644 --- a/packages/editor-ui/src/views/SettingsSourceControl.vue +++ b/packages/editor-ui/src/views/SettingsSourceControl.vue @@ -130,7 +130,7 @@ const repoUrlValidationRules: Array = [ name: 'MATCH_REGEX', config: { 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_.\-\/]+)*$/, + /^(ssh:\/\/)?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'), }, }, diff --git a/packages/editor-ui/src/views/__tests__/SettingsSourceControl.test.ts b/packages/editor-ui/src/views/__tests__/SettingsSourceControl.test.ts index 9f3d0007c3..163e81c284 100644 --- a/packages/editor-ui/src/views/__tests__/SettingsSourceControl.test.ts +++ b/packages/editor-ui/src/views/__tests__/SettingsSourceControl.test.ts @@ -169,6 +169,7 @@ describe('SettingsSourceControl', () => { ['git@github.enterprise.com:org-name/repo-name', true], ['git@192.168.1.101:2222:user/repo', true], ['git@ssh.dev.azure.com:v3/User/repo/directory', true], + ['ssh://git@mydomain.example:2224/gitolite-admin', true], ['http://github.com/user/repository', false], ['https://github.com/user/repository', false], ])('%s', async (url: string, isValid: boolean) => {