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, set additionalProperties: false at 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.
- Improve and add tests
- Update and expand tests in
pkg/parser/schema_test.go and pkg/parser/schema_location_test.go to 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).
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.
Summary
Strengthen the validation of frontmatter schemas by setting
additionalProperties: falseat 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
pkg/parser/schemas/main_workflow_schema.json, setadditionalProperties: falseat every object level (where applicable).pkg/parser/schema_test.goandpkg/parser/schema_location_test.goto ensure invalid keys are rejected and all expected keys/values are accepted.Relevant Code
Schema validation implementation:
pkg/parser/schema.goValidateMainWorkflowFrontmatterWithSchema,validateWithSchema,validateWithSchemaAndLocationExisting test coverage:
pkg/parser/schema_test.gopkg/parser/schema_location_test.goAcceptance Criteria
additionalProperties: false).References:
Example test cases (see more in
schema_test.go):If you have questions about which properties are supported, consult the official schema and the current test cases in the codebase.