Skip to content

CICD-090 · Upload diagnostics on failing checks ​

Encyclopedia · Tests and quality checks · All snippets

Previous · CICD-089 · Next · CICD-091

1. Where it fits ​

  • Placement .github/workflows/ci.yml, under a job's steps.
  • Prerequisites repository with test fixtures and task-specific quality dependencies.
  • Platforms github-actions.

2. Copy the snippet ​

yaml
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
  name: diagnostics
  path: reports/

3. How it works ​

The failure status function keeps the upload step eligible after an earlier step fails. The report producer must still write an artifact path the uploader can find.

The normal gate fails while the diagnostics can still be uploaded.

flowchart TD
  N1["Verification"]
  N2{"Step failed"}
  N1 --> N2
  N3["Upload diagnostics"]
  N2 -->|Yes| N3
  N4["Continue normally"]
  N2 -->|No| N4

4. Verify the result ​

Keep logs scrubbed of secrets and configure a short retention period.

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