Skip to content

Commit b6f16d2

Browse files
r00gmTianYi0217
authored andcommitted
fix(editor): Fix regExp to allow "." in Git repository URL (SSH) (n8n-io#15972)
1 parent 80ba117 commit b6f16d2

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

packages/frontend/editor-ui/src/views/SettingsSourceControl.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ describe('SettingsSourceControl', () => {
174174
['[email protected]/repo.git', true],
175175
['http://github.com/user/repository', false],
176176
['https://github.com/user/repository', false],
177+
['[email protected]:something.net/n8n.git', true],
177178
])('%s', async (url: string, isValid: boolean) => {
178179
await nextTick();
179180
const { container, queryByText } = renderComponent({

packages/frontend/editor-ui/src/views/SettingsSourceControl.vue

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<script lang="ts" setup>
2-
import { computed, reactive, ref, onMounted } from 'vue';
3-
import type { Rule, RuleGroup } from '@n8n/design-system/types';
4-
import { MODAL_CONFIRM } from '@/constants';
5-
import { useSourceControlStore } from '@/stores/sourceControl.store';
6-
import { useToast } from '@/composables/useToast';
2+
import CopyInput from '@/components/CopyInput.vue';
3+
import { useDocumentTitle } from '@/composables/useDocumentTitle';
74
import { useLoadingService } from '@/composables/useLoadingService';
8-
import { useI18n } from '@n8n/i18n';
95
import { useMessage } from '@/composables/useMessage';
10-
import { useDocumentTitle } from '@/composables/useDocumentTitle';
11-
import CopyInput from '@/components/CopyInput.vue';
12-
import type { TupleToUnion } from '@/utils/typeHelpers';
13-
import type { SshKeyTypes } from '@/types/sourceControl.types';
146
import { usePageRedirectionHelper } from '@/composables/usePageRedirectionHelper';
7+
import { useToast } from '@/composables/useToast';
8+
import { MODAL_CONFIRM } from '@/constants';
9+
import { useSourceControlStore } from '@/stores/sourceControl.store';
10+
import type { SshKeyTypes } from '@/types/sourceControl.types';
11+
import type { TupleToUnion } from '@/utils/typeHelpers';
12+
import type { Rule, RuleGroup } from '@n8n/design-system/types';
13+
import { useI18n } from '@n8n/i18n';
14+
import { computed, onMounted, reactive, ref } from 'vue';
1515
1616
const locale = useI18n();
1717
const sourceControlStore = useSourceControlStore();
@@ -134,7 +134,7 @@ const repoUrlValidationRules: Array<Rule | RuleGroup> = [
134134
name: 'MATCH_REGEX',
135135
config: {
136136
regex:
137-
/^(?:git@|ssh:\/\/git@|[\w-]+@)(?:[\w.-]+|\[[0-9a-fA-F:]+])(?::\d+)?[:\/][\w\-~]+(?:\/[\w\-~]+)*(?:\.git)?(?:\/.*)?$/,
137+
/^(?:git@|ssh:\/\/git@|[\w-]+@)(?:[\w.-]+|\[[0-9a-fA-F:]+])(?::\d+)?[:\/][\w\-~.]+(?:\/[\w\-~.]+)*(?:\.git)?(?:\/.*)?$/,
138138
message: locale.baseText('settings.sourceControl.repoUrlInvalid'),
139139
},
140140
},

0 commit comments

Comments
 (0)