mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
fix(editor): Allow custom git repo urls in source control settings (#10849)
This commit is contained in:
parent
d81e72b6c7
commit
a63a9b53f0
|
@ -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'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue