From 692ac7ba70640823fcf0e9a910e62d363ee69502 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 24 Aug 2026 20:18:57 +0000 Subject: [PATCH 1/2] Initial plan From fddb88b1a1f1fa2cb7287ff5d687841eae29be33 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 24 Aug 2026 20:31:38 +0000 Subject: [PATCH 2/2] fix: preserve quoted cron expressions in frontmatter updates Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/parser/frontmatter_helpers_test.go | 22 ++++++++++++++++++++++ pkg/parser/workflow_update.go | 1 + 2 files changed, 23 insertions(+) diff --git a/pkg/parser/frontmatter_helpers_test.go b/pkg/parser/frontmatter_helpers_test.go index f886a4d87a8..e7288029c59 100644 --- a/pkg/parser/frontmatter_helpers_test.go +++ b/pkg/parser/frontmatter_helpers_test.go @@ -148,6 +148,28 @@ engine: claude } } +func TestUpdateWorkflowFrontmatterQuotesCronExpressions(t *testing.T) { + workflowPath := filepath.Join(testutil.TempDir(t, "test-*"), "scheduled-workflow.md") + initialContent := `--- +on: + schedule: + - cron: "0 14 * * 1-5" +--- +# Scheduled Workflow` + require.NoError(t, os.WriteFile(workflowPath, []byte(initialContent), 0644)) + + err := UpdateWorkflowFrontmatter(workflowPath, func(frontmatter map[string]any) error { + frontmatter["engine"] = "copilot" + return nil + }, false) + require.NoError(t, err) + + updatedContent, err := os.ReadFile(workflowPath) + require.NoError(t, err) + assert.Contains(t, string(updatedContent), `cron: "0 14 * * 1-5"`) + assert.Contains(t, string(updatedContent), "engine: copilot") +} + func TestUpdateWorkflowFrontmatterErrorIncludesWorkflowPath(t *testing.T) { tempDir := testutil.TempDir(t, "test-*") diff --git a/pkg/parser/workflow_update.go b/pkg/parser/workflow_update.go index a527475ce19..735225f5303 100644 --- a/pkg/parser/workflow_update.go +++ b/pkg/parser/workflow_update.go @@ -48,6 +48,7 @@ func UpdateWorkflowFrontmatter(workflowPath string, updateFunc func(frontmatter if err != nil { return fmt.Errorf("could not marshal updated frontmatter for %q; ensure updated values are YAML-serializable, then retry: %w", workflowPath, err) } + updatedFrontmatter = []byte(QuoteCronExpressions(string(updatedFrontmatter))) // Reconstruct the file content updatedContent, err := ReconstructWorkflowFile(string(updatedFrontmatter), result.Markdown)