[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot] 2025-03-30 08:51:24 +00:00 committed by GitHub
parent 64a77decfd
commit 67e85cabcb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 76 additions and 47 deletions

View File

@ -67,15 +67,11 @@ export const cloneBitbucketRepository = async (
if (recurseSubmodules) {
cloneArgs.splice(4, 0, "--recurse-submodules");
}
await spawnAsync(
"git",
cloneArgs,
(data) => {
if (writeStream.writable) {
writeStream.write(data);
}
},
);
await spawnAsync("git", cloneArgs, (data) => {
if (writeStream.writable) {
writeStream.write(data);
}
});
writeStream.write(`\nCloned ${repoclone} to ${outputPath}: ✅\n`);
} catch (error) {
writeStream.write(`ERROR Clonning: ${error}: ❌`);

View File

@ -23,7 +23,13 @@ export const cloneGitRepository = async (
isCompose = false,
) => {
const { SSH_PATH, COMPOSE_PATH, APPLICATIONS_PATH } = paths();
const { appName, customGitUrl, customGitBranch, customGitSSHKeyId, recurseSubmodules = true } = entity;
const {
appName,
customGitUrl,
customGitBranch,
customGitSSHKeyId,
recurseSubmodules = true,
} = entity;
if (!customGitUrl || !customGitBranch) {
throw new TRPCError({
@ -269,7 +275,13 @@ export const cloneGitRawRepository = async (entity: {
customGitSSHKeyId?: string | null;
recurseSubmodules?: boolean;
}) => {
const { appName, customGitUrl, customGitBranch, customGitSSHKeyId, recurseSubmodules = true } = entity;
const {
appName,
customGitUrl,
customGitBranch,
customGitSSHKeyId,
recurseSubmodules = true,
} = entity;
if (!customGitUrl || !customGitBranch) {
throw new TRPCError({
@ -327,19 +339,14 @@ export const cloneGitRawRepository = async (entity: {
if (recurseSubmodules) {
cloneArgs.splice(4, 0, "--recurse-submodules");
}
await spawnAsync(
"git",
cloneArgs,
(_data) => {},
{
env: {
...process.env,
...(customGitSSHKeyId && {
GIT_SSH_COMMAND: `ssh -i ${temporalKeyPath}${port ? ` -p ${port}` : ""} -o UserKnownHostsFile=${knownHostsPath}`,
}),
},
await spawnAsync("git", cloneArgs, (_data) => {}, {
env: {
...process.env,
...(customGitSSHKeyId && {
GIT_SSH_COMMAND: `ssh -i ${temporalKeyPath}${port ? ` -p ${port}` : ""} -o UserKnownHostsFile=${knownHostsPath}`,
}),
},
);
});
} catch (error) {
throw error;
}

View File

@ -143,15 +143,11 @@ export const cloneGithubRepository = async ({
if (recurseSubmodules) {
cloneArgs.splice(4, 0, "--recurse-submodules");
}
await spawnAsync(
"git",
cloneArgs,
(data) => {
if (writeStream.writable) {
writeStream.write(data);
}
},
);
await spawnAsync("git", cloneArgs, (data) => {
if (writeStream.writable) {
writeStream.write(data);
}
});
writeStream.write(`\nCloned ${repoclone}: ✅\n`);
} catch (error) {
writeStream.write(`ERROR Clonning: ${error}: ❌`);
@ -233,7 +229,14 @@ echo "Cloned ${repoclone} to ${outputPath}: ✅" >> ${logPath};
};
export const cloneRawGithubRepository = async (entity: Compose) => {
const { appName, repository, owner, branch, githubId, recurseSubmodules = true } = entity;
const {
appName,
repository,
owner,
branch,
githubId,
recurseSubmodules = true,
} = entity;
if (!githubId) {
throw new TRPCError({
@ -271,7 +274,15 @@ export const cloneRawGithubRepository = async (entity: Compose) => {
};
export const cloneRawGithubRepositoryRemote = async (compose: Compose) => {
const { appName, repository, owner, branch, githubId, serverId, recurseSubmodules = true } = compose;
const {
appName,
repository,
owner,
branch,
githubId,
serverId,
recurseSubmodules = true,
} = compose;
if (!serverId) {
throw new TRPCError({

View File

@ -90,8 +90,14 @@ export const cloneGitlabRepository = async (
isCompose = false,
) => {
const writeStream = createWriteStream(logPath, { flags: "a" });
const { appName, gitlabBranch, gitlabId, gitlab, gitlabPathNamespace, recurseSubmodules = true } =
entity;
const {
appName,
gitlabBranch,
gitlabId,
gitlab,
gitlabPathNamespace,
recurseSubmodules = true,
} = entity;
if (!gitlabId) {
throw new TRPCError({
@ -140,15 +146,11 @@ export const cloneGitlabRepository = async (
if (recurseSubmodules) {
cloneArgs.splice(4, 0, "--recurse-submodules");
}
await spawnAsync(
"git",
cloneArgs,
(data) => {
if (writeStream.writable) {
writeStream.write(data);
}
},
);
await spawnAsync("git", cloneArgs, (data) => {
if (writeStream.writable) {
writeStream.write(data);
}
});
writeStream.write(`\nCloned ${repoclone}: ✅\n`);
} catch (error) {
writeStream.write(`ERROR Clonning: ${error}: ❌`);
@ -330,7 +332,13 @@ export const getGitlabBranches = async (input: {
};
export const cloneRawGitlabRepository = async (entity: Compose) => {
const { appName, gitlabBranch, gitlabId, gitlabPathNamespace, recurseSubmodules = true } = entity;
const {
appName,
gitlabBranch,
gitlabId,
gitlabPathNamespace,
recurseSubmodules = true,
} = entity;
if (!gitlabId) {
throw new TRPCError({
@ -371,7 +379,14 @@ export const cloneRawGitlabRepository = async (entity: Compose) => {
};
export const cloneRawGitlabRepositoryRemote = async (compose: Compose) => {
const { appName, gitlabPathNamespace, branch, gitlabId, serverId, recurseSubmodules = true } = compose;
const {
appName,
gitlabPathNamespace,
branch,
gitlabId,
serverId,
recurseSubmodules = true,
} = compose;
if (!serverId) {
throw new TRPCError({