mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 11:49:59 +00:00
fix(editor): Allow custom git repo urls in source control settings (#10849)
This commit is contained in:
@@ -170,6 +170,8 @@ describe('SettingsSourceControl', () => {
|
|||||||
['git@192.168.1.101:2222:user/repo', true],
|
['git@192.168.1.101:2222:user/repo', true],
|
||||||
['git@ssh.dev.azure.com:v3/User/repo/directory', true],
|
['git@ssh.dev.azure.com:v3/User/repo/directory', true],
|
||||||
['ssh://git@mydomain.example:2224/gitolite-admin', true],
|
['ssh://git@mydomain.example:2224/gitolite-admin', true],
|
||||||
|
['gituser@192.168.1.1:ABC/Repo4.git', true],
|
||||||
|
['root@192.168.1.1/repo.git', true],
|
||||||
['http://github.com/user/repository', false],
|
['http://github.com/user/repository', false],
|
||||||
['https://github.com/user/repository', false],
|
['https://github.com/user/repository', false],
|
||||||
])('%s', async (url: string, isValid: boolean) => {
|
])('%s', async (url: string, isValid: boolean) => {
|
||||||
@@ -131,7 +131,7 @@ const repoUrlValidationRules: Array<Rule | RuleGroup> = [
|
|||||||
name: 'MATCH_REGEX',
|
name: 'MATCH_REGEX',
|
||||||
config: {
|
config: {
|
||||||
regex:
|
regex:
|
||||||
/^(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_.\-\/]+)*$/,
|
/^(?:git@|ssh:\/\/git@|[\w-]+@)(?:[\w.-]+|\[[0-9a-fA-F:]+])(?::\d+)?[:\/][\w\-~]+(?:\/[\w\-~]+)*(?:\.git)?(?:\/.*)?$/,
|
||||||
message: locale.baseText('settings.sourceControl.repoUrlInvalid'),
|
message: locale.baseText('settings.sourceControl.repoUrlInvalid'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user