diff --git a/.github/workflows/test-claude-create-pull-request.lock.yml b/.github/workflows/test-claude-create-pull-request.lock.yml index 2f0c90325a5..7f415dceee9 100644 --- a/.github/workflows/test-claude-create-pull-request.lock.yml +++ b/.github/workflows/test-claude-create-pull-request.lock.yml @@ -1777,7 +1777,8 @@ jobs: // Apply the patch using git CLI (skip if empty) if (!isEmpty) { console.log("Applying patch..."); - execSync("git apply /tmp/aw.patch", { stdio: "inherit" }); + // Patches are created with git format-patch, so use git am to apply them + execSync("git am /tmp/aw.patch", { stdio: "inherit" }); console.log("Patch applied successfully"); } else { console.log("Skipping patch application (empty patch)"); diff --git a/.github/workflows/test-claude-push-to-branch.lock.yml b/.github/workflows/test-claude-push-to-branch.lock.yml index 837ffdbf278..a8510ef91f5 100644 --- a/.github/workflows/test-claude-push-to-branch.lock.yml +++ b/.github/workflows/test-claude-push-to-branch.lock.yml @@ -1848,7 +1848,8 @@ jobs: if (!isEmpty) { console.log("Applying patch..."); try { - execSync("git apply /tmp/aw.patch", { stdio: "inherit" }); + // Patches are created with git format-patch, so use git am to apply them + execSync("git am /tmp/aw.patch", { stdio: "inherit" }); console.log("Patch applied successfully"); } catch (error) { core.error( diff --git a/.github/workflows/test-codex-create-pull-request.lock.yml b/.github/workflows/test-codex-create-pull-request.lock.yml index 46a77cdef5e..cdfb0bc1d50 100644 --- a/.github/workflows/test-codex-create-pull-request.lock.yml +++ b/.github/workflows/test-codex-create-pull-request.lock.yml @@ -1526,7 +1526,8 @@ jobs: // Apply the patch using git CLI (skip if empty) if (!isEmpty) { console.log("Applying patch..."); - execSync("git apply /tmp/aw.patch", { stdio: "inherit" }); + // Patches are created with git format-patch, so use git am to apply them + execSync("git am /tmp/aw.patch", { stdio: "inherit" }); console.log("Patch applied successfully"); } else { console.log("Skipping patch application (empty patch)"); diff --git a/.github/workflows/test-codex-push-to-branch.lock.yml b/.github/workflows/test-codex-push-to-branch.lock.yml index e56905c5cf9..18883a8990c 100644 --- a/.github/workflows/test-codex-push-to-branch.lock.yml +++ b/.github/workflows/test-codex-push-to-branch.lock.yml @@ -1599,7 +1599,8 @@ jobs: if (!isEmpty) { console.log("Applying patch..."); try { - execSync("git apply /tmp/aw.patch", { stdio: "inherit" }); + // Patches are created with git format-patch, so use git am to apply them + execSync("git am /tmp/aw.patch", { stdio: "inherit" }); console.log("Patch applied successfully"); } catch (error) { core.error( diff --git a/.github/workflows/test-safe-outputs-custom-engine.lock.yml b/.github/workflows/test-safe-outputs-custom-engine.lock.yml index e74a7882046..4f01406b60d 100644 --- a/.github/workflows/test-safe-outputs-custom-engine.lock.yml +++ b/.github/workflows/test-safe-outputs-custom-engine.lock.yml @@ -2665,7 +2665,8 @@ jobs: // Apply the patch using git CLI (skip if empty) if (!isEmpty) { console.log("Applying patch..."); - execSync("git apply /tmp/aw.patch", { stdio: "inherit" }); + // Patches are created with git format-patch, so use git am to apply them + execSync("git am /tmp/aw.patch", { stdio: "inherit" }); console.log("Patch applied successfully"); } else { console.log("Skipping patch application (empty patch)"); @@ -3335,7 +3336,8 @@ jobs: if (!isEmpty) { console.log("Applying patch..."); try { - execSync("git apply /tmp/aw.patch", { stdio: "inherit" }); + // Patches are created with git format-patch, so use git am to apply them + execSync("git am /tmp/aw.patch", { stdio: "inherit" }); console.log("Patch applied successfully"); } catch (error) { core.error( diff --git a/pkg/workflow/js/create_pull_request.cjs b/pkg/workflow/js/create_pull_request.cjs index cf5c072de11..3361793c546 100644 --- a/pkg/workflow/js/create_pull_request.cjs +++ b/pkg/workflow/js/create_pull_request.cjs @@ -210,7 +210,8 @@ async function main() { // Apply the patch using git CLI (skip if empty) if (!isEmpty) { console.log("Applying patch..."); - execSync("git apply /tmp/aw.patch", { stdio: "inherit" }); + // Patches are created with git format-patch, so use git am to apply them + execSync("git am /tmp/aw.patch", { stdio: "inherit" }); console.log("Patch applied successfully"); } else { console.log("Skipping patch application (empty patch)"); diff --git a/pkg/workflow/js/create_pull_request.test.cjs b/pkg/workflow/js/create_pull_request.test.cjs index 979d9196cf6..ede13dd8c23 100644 --- a/pkg/workflow/js/create_pull_request.test.cjs +++ b/pkg/workflow/js/create_pull_request.test.cjs @@ -186,7 +186,7 @@ describe("create_pull_request.cjs", () => { { stdio: "inherit" } ); expect(mockDependencies.execSync).toHaveBeenCalledWith( - "git apply /tmp/aw.patch", + "git am /tmp/aw.patch", { stdio: "inherit" } ); expect(mockDependencies.execSync).toHaveBeenCalledWith("git add .", { diff --git a/pkg/workflow/js/push_to_branch.cjs b/pkg/workflow/js/push_to_branch.cjs index 5dedd211853..7a8ea63d1ee 100644 --- a/pkg/workflow/js/push_to_branch.cjs +++ b/pkg/workflow/js/push_to_branch.cjs @@ -152,7 +152,8 @@ async function main() { if (!isEmpty) { console.log("Applying patch..."); try { - execSync("git apply /tmp/aw.patch", { stdio: "inherit" }); + // Patches are created with git format-patch, so use git am to apply them + execSync("git am /tmp/aw.patch", { stdio: "inherit" }); console.log("Patch applied successfully"); } catch (error) { core.error( diff --git a/pkg/workflow/js/push_to_branch.test.cjs b/pkg/workflow/js/push_to_branch.test.cjs index 8af1e21614d..6ec274e4c98 100644 --- a/pkg/workflow/js/push_to_branch.test.cjs +++ b/pkg/workflow/js/push_to_branch.test.cjs @@ -84,7 +84,7 @@ describe("push_to_branch.cjs", () => { // Check that patch operations are included expect(scriptContent).toContain("fs.existsSync"); expect(scriptContent).toContain("fs.readFileSync"); - expect(scriptContent).toContain("git apply"); + expect(scriptContent).toContain("git am"); expect(scriptContent).toContain("git commit"); expect(scriptContent).toContain("git push"); });