Interview Prep/GitHub Actions/Expressions, Outputs, Matrix & Conditions

`Error when evaluating 'strategy' for job 'build'. .github/workflows/ci.yml (Line: 30, Col: 15): Matrix vector 'service' does not contain any values`

IntermediateTroubleshootingExpressions, Outputs, Matrix & Conditions
Answer

Likely causes → The dynamic matrix list is empty ([]), usually because no services changed.

Diagnose → Print needs.changes.outputs.services in the summary.

Fix →

build:
  needs: changes
  if: needs.changes.outputs.services != '[]' && needs.changes.outputs.services != ''

Prevent → Always guard dynamic matrices and keep a fan-in job that accepts skipped.

All GitHub Actions questions Roadmap: GitHub Actions

More on Expressions, Outputs, Matrix & Conditions