feat(core): Add HTTPS protocol support for repository connections (#18250)

Co-authored-by: konstantintieber <konstantin.tieber@n8n.io>
This commit is contained in:
Idir Ouhab Meskine
2025-09-10 16:08:07 +02:00
committed by GitHub
parent eb389a787b
commit 5c6094dfd7
16 changed files with 1858 additions and 162 deletions

View File

@@ -126,14 +126,21 @@ export class SourceControlService {
async disconnect(options: { keepKeyPair?: boolean } = {}) {
try {
const preferences = this.sourceControlPreferencesService.getPreferences();
await this.sourceControlPreferencesService.setPreferences({
connected: false,
branchName: '',
connectionType: 'ssh',
});
await this.sourceControlExportService.deleteRepositoryFolder();
if (!options.keepKeyPair) {
if (preferences.connectionType === 'https') {
await this.sourceControlPreferencesService.deleteHttpsCredentials();
} else if (!options.keepKeyPair) {
await this.sourceControlPreferencesService.deleteKeyPair();
}
this.gitService.resetService();
return this.sourceControlPreferencesService.sourceControlPreferences;
} catch (error) {
@@ -212,6 +219,9 @@ export class SourceControlService {
await this.initGitService();
}
try {
const currentBranch = this.sourceControlPreferencesService.getBranchName();
await this.gitService.fetch();
await this.gitService.setBranch(currentBranch);
await this.gitService.resetBranch();
await this.gitService.pull();
} catch (error) {