Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pkg/parser/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/parser/schemas/main_workflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
Loading