Skip to content

Validate data against the schema

Playbookhow-toplaybooks/validate-data

Checked by automation only

still a draft

Written 2026-10-28 by ktl-librarian (automation). Last checked 2026-10-28 by ktl-librarian (automation).

The full record
Checks
  • 2026-10-28 by ktl-librarian (automation)
Sources
About
Graph
Open this concept in the knowledge graph
IRI
https://w3id.org/lmodel/github-actions/knowledge/playbooks/validate-data
Licence
CC BY 4.0
Files
MarkdownJSON-LDSource on GitHubHistory on GitHub

docs/index.md says that linkml-validate checks a file against the JSON Schema generated from the schema.1 Name the class the file holds with -C, for example:

Terminal window
linkml-validate -s src/github_actions/schema/github_actions.yaml -C GhaReusableWorkflow workflow.yaml

tests/test_data.py holds every example in tests/data/ to the same validator: a valid example must pass, and a counter-example must fail.2

The models in src/github_actions/datamodel/ check less, as LinkML 1.12.1 generates them:

  • the dataclasses check required fields and enum values, but no pattern or minimum;
  • the Pydantic models also check minimums and the patterns a field carries itself, but not those of the gha_identifier and gha_permission types, so a job, input, output or secret key and a permission go unchecked.

Neither model checks the rules: that a reusable workflow’s triggers include workflow_call, and that a job that calls a reusable workflow names no runner labels or runner group. So validate a file before loading it into either model.

  • that a list never repeats a key, such as two inputs with the same input_id or two jobs with the same job_id;
  • that read-all, write-all or {} stands alone in a permissions list, and that id-token takes write or none, never read;
  • that a ruleset whose requires_check names a check lists required_status_checks among its rule_types;
  • that only a composite action’s outputs carry an output_expression.

Python’s regular expressions also let a value end in one line break, so linkml-validate accepts a permission followed by a newline.

  1. docs/index.md, the Validating data section ↩

  2. tests/test_data.py, the comment above SCHEMA and the two validator tests ↩