mirror of
https://github.com/tiennm99/coolify.git
synced 2026-05-01 12:20:47 +00:00
fix: secrets with newline
This commit is contained in:
@@ -468,13 +468,26 @@ export async function restartApplication(request: FastifyRequest<RestartApplicat
|
||||
if (pullmergeRequestId) {
|
||||
const isSecretFound = secrets.filter(s => s.name === secret.name && s.isPRMRSecret)
|
||||
if (isSecretFound.length > 0) {
|
||||
if (isSecretFound[0].value.includes('\\n')) {
|
||||
envs.push(`${secret.name}=${isSecretFound[0].value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${isSecretFound[0].value}'`);
|
||||
|
||||
}
|
||||
} else {
|
||||
if (secret.value.includes('\\n')) {
|
||||
envs.push(`${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${secret.value}'`);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!secret.isPRMRSecret) {
|
||||
if (secret.value.includes('\\n')) {
|
||||
envs.push(`${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${secret.value}'`);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1169,13 +1182,25 @@ export async function restartPreview(request: FastifyRequest<RestartPreviewAppli
|
||||
if (pullmergeRequestId) {
|
||||
const isSecretFound = secrets.filter(s => s.name === secret.name && s.isPRMRSecret)
|
||||
if (isSecretFound.length > 0) {
|
||||
if (isSecretFound[0].value.includes('\\n')) {
|
||||
envs.push(`${secret.name}=${isSecretFound[0].value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${isSecretFound[0].value}'`);
|
||||
}
|
||||
} else {
|
||||
if (secret.value.includes('\\n')) {
|
||||
envs.push(`${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${secret.value}'`);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!secret.isPRMRSecret) {
|
||||
if (secret.value.includes('\\n')) {
|
||||
envs.push(`${secret.name}=${secret.value}`);
|
||||
} else {
|
||||
envs.push(`${secret.name}='${secret.value}'`);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1604,4 +1629,4 @@ export async function removeBranchDatabase(database: any, pullmergeRequestId: st
|
||||
} catch ({ status, message }) {
|
||||
return errorHandler({ status, message })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user