Skip to content

CICD-491 · Mandatory quality gates ​

Encyclopedia · Pipeline governance and operational management · All snippets

Previous · CICD-490 · Next · CICD-492

1. Where it fits ​

  • Placement Under the workflow's jobs map, alongside the named lint and test jobs.
  • Prerequisites trusted policy checkout and normalized deployment events with scoped access.
  • Platforms github-actions.
  • Parameters LINT, TEST.

2. Copy the snippet ​

yaml
quality-gate:
  needs: [lint, test]
  if: ${{ !cancelled() }}
  runs-on: ubuntu-latest
  steps:
    - env:
        LINT: ${{ needs.lint.result }}
        TEST: ${{ needs.test.result }}
      run: test "$LINT" = success && test "$TEST" = success

3. How it works ​

The job can inspect lint and test even if one fails. Its explicit status checks translate dependency state into a single stable required result.

The gate emits one required status for two verification jobs.

flowchart TD
  N1["Lint result"]
  N2{"Both results successful"}
  N1 --> N2
  N3["Test result"]
  N3 --> N2
  N4["Gate passes"]
  N2 -->|Yes| N4
  N5["Gate fails"]
  N2 -->|No| N5

4. Verify the result ​

Protect the exact gate check name and test a failed dependency. Cancellation remains visible as cancellation.

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