From 3c53aa5db366a2ef711d268749118f1542dcb7ea Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 16 Jun 2026 18:21:20 +0000 Subject: [PATCH 1/3] Initial plan From f048de7d0be9682ed5ad792867b68fdd77aafb50 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 16 Jun 2026 18:45:07 +0000 Subject: [PATCH 2/3] Add required-category to create-discussion schema branch Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/parser/schemas/main_workflow_schema.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/parser/schemas/main_workflow_schema.json b/pkg/parser/schemas/main_workflow_schema.json index b5040a2d38e..f94d51e14c7 100644 --- a/pkg/parser/schemas/main_workflow_schema.json +++ b/pkg/parser/schemas/main_workflow_schema.json @@ -5689,6 +5689,10 @@ "minLength": 1, "pattern": "\\S" }, + "required-category": { + "type": "string", + "description": "Required category for matching when close-older-discussions is enabled. Only discussions in this category will be considered when searching for older discussions to close." + }, "fallback-to-issue": { "type": "boolean", "description": "When true (default), fallback to creating an issue if discussion creation fails due to permissions. The fallback issue will include a note indicating it was intended to be a discussion. If close-older-discussions is enabled, the close-older-issues logic will be applied to the fallback issue.", From 52418f9104140df416cfadc6ad426a8d016f8ae8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 16 Jun 2026 21:44:38 +0000 Subject: [PATCH 3/3] Add create-discussion required-category coverage Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/parser/schema_test.go | 19 +++++++++++++++++++ pkg/parser/schemas/main_workflow_schema.json | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/pkg/parser/schema_test.go b/pkg/parser/schema_test.go index a947eae3194..e169b57396e 100644 --- a/pkg/parser/schema_test.go +++ b/pkg/parser/schema_test.go @@ -1025,6 +1025,25 @@ func TestGetSafeOutputTypeKeys(t *testing.T) { } } +func TestMainWorkflowSchema_CreateDiscussionRequiredCategoryAllowed(t *testing.T) { + t.Parallel() + + frontmatter := map[string]any{ + "on": "daily", + "safe-outputs": map[string]any{ + "create-discussion": map[string]any{ + "category": "Ideas", + "close-older-discussions": true, + "required-category": "Ideas", + }, + }, + } + + if err := validateWithSchema(frontmatter, mainWorkflowSchema, "main workflow file"); err != nil { + t.Fatalf("expected create-discussion.required-category to pass schema validation, got: %v", err) + } +} + func TestMainWorkflowSchemaPushToPullRequestBranchHasMaxPatchSize(t *testing.T) { schemaPath := "schemas/main_workflow_schema.json" schemaContent, err := os.ReadFile(schemaPath) diff --git a/pkg/parser/schemas/main_workflow_schema.json b/pkg/parser/schemas/main_workflow_schema.json index f94d51e14c7..7a0917681ef 100644 --- a/pkg/parser/schemas/main_workflow_schema.json +++ b/pkg/parser/schemas/main_workflow_schema.json @@ -5766,7 +5766,8 @@ { "title-prefix": "[weekly-report] ", "category": "reports", - "close-older-discussions": true + "close-older-discussions": true, + "required-category": "reports" }, { "labels": ["weekly-report", "automation"],