From 330e921e0ce766cb2ec8f7ff65a77fe31b23c5de Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 11 Aug 2026 15:36:28 +0000 Subject: [PATCH 1/2] Initial plan From 3e6191d6c8b6780e2e1b1ed3076a94d64af8f691 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 11 Aug 2026 15:43:45 +0000 Subject: [PATCH 2/2] Allow repository dispatch rate limits Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/parser/schema_test.go | 14 ++++++++++++++ pkg/parser/schemas/main_workflow_schema.json | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/pkg/parser/schema_test.go b/pkg/parser/schema_test.go index 28933618a1e..763b2c7fc25 100644 --- a/pkg/parser/schema_test.go +++ b/pkg/parser/schema_test.go @@ -137,6 +137,20 @@ timeout_minu tes: 10 } } +func TestMainWorkflowSchema_UserRateLimitAllowsRepositoryDispatch(t *testing.T) { + frontmatter := map[string]any{ + "on": "repository_dispatch", + "user-rate-limit": map[string]any{ + "max-runs-per-window": 1, + "events": []any{"repository_dispatch"}, + }, + } + + if err := validateWithSchema(frontmatter, mainWorkflowSchema, "main workflow file"); err != nil { + t.Fatalf("repository_dispatch should be allowed for user-rate-limit events: %v", err) + } +} + // TestValidateMCPConfigWithSchema tests the ValidateMCPConfigWithSchema function // which validates a single MCP server configuration against the MCP config JSON schema. func TestValidateMCPConfigWithSchema(t *testing.T) { diff --git a/pkg/parser/schemas/main_workflow_schema.json b/pkg/parser/schemas/main_workflow_schema.json index 4bfa6b05ed0..a85f568303a 100644 --- a/pkg/parser/schemas/main_workflow_schema.json +++ b/pkg/parser/schemas/main_workflow_schema.json @@ -11723,7 +11723,7 @@ "description": "Optional list of event types to apply rate limiting to. If not specified, rate limiting applies to all programmatically triggered events (e.g., workflow_dispatch, issue_comment, pull_request_review).", "items": { "type": "string", - "enum": ["workflow_dispatch", "issue_comment", "pull_request_review", "pull_request_review_comment", "issues", "pull_request", "discussion_comment", "discussion"] + "enum": ["workflow_dispatch", "issue_comment", "pull_request_review", "pull_request_review_comment", "issues", "pull_request", "discussion_comment", "discussion", "repository_dispatch"] }, "minItems": 1 },