Skip to content

CICD-196 · Capture failed workflow metadata ​

Encyclopedia · CI diagnostics and evidence · All snippets

Previous · CICD-195 · Next · CICD-197

1. Where it fits ​

  • Placement Bash run step following checkout, or equivalent lab terminal.
  • Prerequisites authorized fixture run and sanitized evidence location.
  • Platforms github-actions, github-cli.
  • Parameters RUN_ID, TARGET_REPO.

2. Copy the snippet ​

bash
gh run view "${RUN_ID:?}" --repo "${TARGET_REPO:?}" --json jobs,conclusion,headSha > run.json

3. How it works ​

The CLI targets a specific workflow run and reads or changes its run state. Check the run ID and attempt at the selected repository.

4. Verify the result ​

Scope reads and see the first failed actionable step.

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