From e5ee06b67e61410e99ac384132cd8cab3ffa495d Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sun, 6 Apr 2025 08:59:02 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes --- .../general/generic/save-github-provider.tsx | 3 ++- apps/dokploy/pages/api/deploy/github.ts | 27 ++++++++++++++----- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/apps/dokploy/components/dashboard/application/general/generic/save-github-provider.tsx b/apps/dokploy/components/dashboard/application/general/generic/save-github-provider.tsx index 5b465ebf..94c29314 100644 --- a/apps/dokploy/components/dashboard/application/general/generic/save-github-provider.tsx +++ b/apps/dokploy/components/dashboard/application/general/generic/save-github-provider.tsx @@ -396,7 +396,8 @@ export const SaveGithubProvider = ({ applicationId }: Props) => {

- Choose when to trigger deployments: on push to the selected branch or when a new tag is created. + Choose when to trigger deployments: on push to the + selected branch or when a new tag is created.

diff --git a/apps/dokploy/pages/api/deploy/github.ts b/apps/dokploy/pages/api/deploy/github.ts index 4b9140d4..ace72148 100644 --- a/apps/dokploy/pages/api/deploy/github.ts +++ b/apps/dokploy/pages/api/deploy/github.ts @@ -91,11 +91,16 @@ export default async function handler( } // Handle tag creation event - if (req.headers["x-github-event"] === "create" && githubBody?.ref_type === "tag") { + if ( + req.headers["x-github-event"] === "create" && + githubBody?.ref_type === "tag" + ) { try { const tagName = githubBody?.ref; const repository = githubBody?.repository?.name; - const owner = githubBody?.repository?.owner?.name || githubBody?.repository?.owner?.login; + const owner = + githubBody?.repository?.owner?.name || + githubBody?.repository?.owner?.login; const deploymentTitle = `Tag created: ${tagName}`; const deploymentHash = githubBody?.master_branch || ""; @@ -175,17 +180,25 @@ export default async function handler( } const totalApps = apps.length + composeApps.length; - + if (totalApps === 0) { - res.status(200).json({ message: "No apps configured to deploy on tag" }); + res + .status(200) + .json({ message: "No apps configured to deploy on tag" }); return; } - - res.status(200).json({ message: `Deployed ${totalApps} apps based on tag ${tagName}` }); + + res + .status(200) + .json({ + message: `Deployed ${totalApps} apps based on tag ${tagName}`, + }); return; } catch (error) { console.error("Error deploying applications on tag:", error); - res.status(400).json({ message: "Error deploying applications on tag", error }); + res + .status(400) + .json({ message: "Error deploying applications on tag", error }); return; } }