Skip to content

Let validate-task.yml Read Its Test Matrix From a Tracked File #4236

Closed

Description

@ptr727

Problem

validate-task.yml takes its pytest legs only as the test-matrix input, a JSON string. A repository whose matrix lives in a tracked file therefore needs a job of its own in each caller. That job checks the tree out, reads the file, and hands the result over as a job output. The catalog/snippets/workflows/test-pull-request*.yml snippets have no such job, so such a repository cannot take the snippet as it stands.

homeassistant-purpleair is the case found. Its matrix file is rewritten by a scheduled tracker as new Home Assistant releases land. The tracker cannot write the matrix inline in the workflow, since a change under .github/workflows/ needs the workflows permission. So both its gate and its publisher carry the same read-versions job ahead of validate.

Found while adopting the gate snippet for WORKFLOW.md D1.5, during a resync at audit run 2026-11-16T22:01:11Z | hub 6e05308.

Proposal

Add a test-matrix-file input to validate-task.yml. It names a path in the caller's checked-out tree whose content has the shape test-matrix takes. It is mutually exclusive with test-matrix, and a missing or malformed file fails the run with an ::error:: naming the path. A caller then passes one with: line instead of carrying a job. The snippet stays exactly as it is, apart from a comment saying the input exists.

A constructed example of such a file:

[
  { "label": "minimum", "ha-version": "2025.1.0" },
  { "label": "latest-stable", "ha-version": "2025.6.1" }
]

Expected and actual

  • Expected: a repository whose matrix is a tracked file adopts the gate and publisher snippets with with: inputs only.
  • Actual: it carries a matrix-reading job in each caller, which no snippet shows and which every such caller repeats.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions