-
Notifications
You must be signed in to change notification settings - Fork 312
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
Strengthen the validation of frontmatter schemas by setting additionalProperties: false at all levels and aligning allowed keys with the official GitHub Actions schema. Several types currently allow additional properties, resulting in weak validation and acceptance of unexpected keys.
Tasks
- List and add missing attributes
- Compare the current schema against the official GitHub Actions workflow schema and enumerate missing/extra attributes.
- Ensure support for both standard GitHub Actions frontmatter and the additional features currently supported by this project.
- Update schema
- In
pkg/parser/schemas/main_workflow_schema.json, setadditionalProperties: falseat every object level (where applicable). - Restrict types more tightly for all fields, matching the GitHub Actions specification and project extensions.
- Remove or relocate any properties not compatible with the schema.
- In
- Improve and add tests
- Update and expand tests in
pkg/parser/schema_test.goandpkg/parser/schema_location_test.goto ensure invalid keys are rejected and all expected keys/values are accepted. - Test both valid and invalid frontmatter, including edge cases (see existing test cases for examples of both valid and invalid scenarios).
- Update and expand tests in
Relevant Code
Schema validation implementation:
pkg/parser/schema.go- Functions:
ValidateMainWorkflowFrontmatterWithSchema,validateWithSchema,validateWithSchemaAndLocation
Existing test coverage:
Acceptance Criteria
- The schema disallows any properties not explicitly listed (using
additionalProperties: false). - All required and optional attributes are present and validated according to the latest GitHub Actions schema and project extensions.
- Tests cover both positive and negative cases (invalid keys, wrong types, missing required fields, etc.).
References:
Example test cases (see more in schema_test.go):
// Invalid properties should fail
frontmatter := map[string]any{"on": "push", "invalid_key": "value"} // error: additional properties not allowed
// Valid properties (should pass)
frontmatter := map[string]any{"on": "push", "engine": "claude"}If you have questions about which properties are supported, consult the official schema and the current test cases in the codebase.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Fields
Give feedbackNo fields configured for Bug.