Skip to content

Commit c2790e1

Browse files
committed
fix(state): bypass hooks for automated pushes
1 parent 26439ce commit c2790e1

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

packages/lib/src/usecases/state-repo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,10 @@ export const statePush = Effect.gen(function*(_) {
260260
gitCapture(root, ["rev-parse", "--abbrev-ref", "HEAD"], env),
261261
Effect.map((value) => value.trim()),
262262
Effect.map((branch) => (branch === "HEAD" ? "main" : branch)),
263-
Effect.flatMap((branch) => git(root, ["push", originUrl, `HEAD:refs/heads/${branch}`], env))
263+
Effect.flatMap((branch) => git(root, ["push", "--no-verify", originUrl, `HEAD:refs/heads/${branch}`], env))
264264
)
265265
)
266-
: git(root, ["push", "-u", "origin", "HEAD"], gitBaseEnv)
266+
: git(root, ["push", "--no-verify", "-u", "origin", "HEAD"], gitBaseEnv)
267267
yield* _(effect)
268268
}).pipe(Effect.asVoid)
269269

packages/lib/src/usecases/state-repo/sync-ops.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const pushToNewBranch = (
9393
const timestamp = yield* _(Effect.sync(() => new Date().toISOString().replaceAll(":", "-").replaceAll(".", "-")))
9494
const branch = sanitizeBranchComponent(`state-sync/${baseBranch}/${timestamp}-${headShort}`)
9595

96-
yield* _(git(root, ["push", originPushTarget, `HEAD:refs/heads/${branch}`], env))
96+
yield* _(git(root, ["push", "--no-verify", originPushTarget, `HEAD:refs/heads/${branch}`], env))
9797
return branch
9898
})
9999

@@ -131,7 +131,9 @@ export const runStateSyncOps = (
131131
return
132132
}
133133

134-
const pushExit = yield* _(gitExitCode(root, ["push", originPushTarget, `HEAD:refs/heads/${baseBranch}`], env))
134+
const pushExit = yield* _(
135+
gitExitCode(root, ["push", "--no-verify", originPushTarget, `HEAD:refs/heads/${baseBranch}`], env)
136+
)
135137
if (pushExit === successExitCode) {
136138
return
137139
}

0 commit comments

Comments
 (0)