feat(github): add triggerType field to GitHub provider and handle tag creation events

This commit is contained in:
Theo D
2025-04-02 22:22:43 +02:00
parent 0bdaa81263
commit fcb8a2bded
6 changed files with 159 additions and 3 deletions

View File

@@ -149,6 +149,7 @@ export const applications = pgTable("application", {
owner: text("owner"),
branch: text("branch"),
buildPath: text("buildPath").default("/"),
triggerType: text("triggerType").default("push"),
autoDeploy: boolean("autoDeploy").$defaultFn(() => true),
// Gitlab
gitlabProjectId: integer("gitlabProjectId"),
@@ -471,7 +472,10 @@ export const apiSaveGithubProvider = createSchema
githubId: true,
watchPaths: true,
})
.required();
.required()
.extend({
triggerType: z.enum(["push", "tag"]).default("push"),
});
export const apiSaveGitlabProvider = createSchema
.pick({

View File

@@ -76,6 +76,7 @@ export const compose = pgTable("compose", {
suffix: text("suffix").notNull().default(""),
randomize: boolean("randomize").notNull().default(false),
isolatedDeployment: boolean("isolatedDeployment").notNull().default(false),
triggerType: text("triggerType").default("push"),
composeStatus: applicationStatus("composeStatus").notNull().default("idle"),
projectId: text("projectId")
.notNull()