Skip to content

Commit c462546

Browse files
committed
Make branch tracking optional
1 parent 69df7db commit c462546

File tree

2 files changed

+6
-6
lines changed
  • apps/webapp/app
    • routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.settings
    • v3

2 files changed

+6
-6
lines changed

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.settings/route.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ const ConnectGitHubRepoFormSchema = z.object({
186186

187187
const UpdateGitSettingsFormSchema = z.object({
188188
action: z.literal("update-git-settings"),
189-
productionBranch: z.string().min(1, "Production branch is required"),
190-
stagingBranch: z.string().min(1, "Staging branch is required"),
189+
productionBranch: z.string().optional(),
190+
stagingBranch: z.string().optional(),
191191
previewDeploymentsEnabled: z
192192
.string()
193193
.optional()
@@ -344,8 +344,8 @@ export const action: ActionFunction = async ({ request, params }) => {
344344
},
345345
data: {
346346
branchTracking: {
347-
production: { branch: productionBranch },
348-
staging: { branch: stagingBranch },
347+
production: productionBranch ? { branch: productionBranch } : {},
348+
staging: stagingBranch ? { branch: stagingBranch } : {},
349349
} satisfies BranchTrackingConfig,
350350
previewDeploymentsEnabled: previewDeploymentsEnabled,
351351
},

apps/webapp/app/v3/github.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { z } from "zod";
22

33
export const BranchTrackingConfigSchema = z.object({
44
production: z.object({
5-
branch: z.string(),
5+
branch: z.string().optional(),
66
}),
77
staging: z.object({
8-
branch: z.string(),
8+
branch: z.string().optional(),
99
}),
1010
});
1111

0 commit comments

Comments
 (0)