diff --git a/apps/dokploy/pages/api/deploy/[refreshToken].ts b/apps/dokploy/pages/api/deploy/[refreshToken].ts index 2ab607736..0ce50cae2 100644 --- a/apps/dokploy/pages/api/deploy/[refreshToken].ts +++ b/apps/dokploy/pages/api/deploy/[refreshToken].ts @@ -159,6 +159,10 @@ export default async function handler( normalizedCommits = req.body?.commits?.flatMap( (commit: any) => commit.modified, ); + } else if (provider === "soft-serve") { + normalizedCommits = req.body?.commits?.flatMap( + (commit: any) => commit.modified, + ); } const shouldDeployPaths = shouldDeploy( @@ -442,6 +446,13 @@ export const extractCommitMessage = (headers: any, body: any) => { : "NEW COMMIT"; } + // Soft Serve + if (headers["x-softserve-event"]) { + return body.commits && body.commits.length > 0 + ? body.commits[0].message + : "NEW COMMIT"; + } + if (headers["user-agent"]?.includes("Go-http-client")) { if (body.push_data && body.repository) { return `DockerHub image pushed: ${body.repository.repo_name}:${body.push_data.tag} by ${body.push_data.pusher}`; @@ -479,6 +490,11 @@ export const extractHash = (headers: any, body: any) => { return body.after || "NEW COMMIT"; } + // Soft Serve + if (headers["x-softserve-event"]) { + return body.after || "NEW COMMIT"; + } + return ""; }; @@ -495,6 +511,10 @@ export const extractBranchName = (headers: any, body: any) => { return body?.push?.changes[0]?.new?.name; } + if (headers["x-softserve-event"]?.includes("push")) { + return body?.ref ? body?.ref.replace("refs/heads/", "") : null; + } + return null; }; @@ -515,6 +535,10 @@ export const getProviderByHeader = (headers: any) => { return "bitbucket"; } + if (headers["x-softserve-event"]) { + return "soft-serve"; + } + return null; };