Skip to content

CICD-044 · Record matrix context safely ​

Encyclopedia · Matrices and sharding · All snippets

Previous · CICD-043 · Next · CICD-045

1. Where it fits ​

  • Placement .github/workflows/ci.yml, under a job's steps.
  • Prerequisites workspace whose runtime dependencies match the chosen target combinations.
  • Platforms github-actions, gitea-actions.
  • Parameters CONFIG.

2. Copy the snippet ​

yaml
env:
  CONFIG: ${{ toJSON(matrix) }}
run: printf '%s\n' "$CONFIG"

3. How it works ​

toJSON serializes the matrix object into a string for this step. It provides visibility into the row selected by the scheduler.

4. Verify the result ​

Use for non-secret matrix data. Compare output across rows.

Validation syntax-validated (YAML parse). Status definitions.