Skip to content
Latchkey

Enforce all checks workflow (corazawaf/coraza)

The Enforce all checks workflow from corazawaf/coraza, explained and optimized by Latchkey.

C

CI health: C - fair

Point runs-on at Latchkey and get run de-duplication, job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: corazawaf/coraza.github/workflows/enforce-all-checks.ymlLicense Apache-2.0View source

What it does

This is the Enforce all checks workflow from the corazawaf/coraza repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
# Aggregates the results of all other checks into a single required status check.
# It must run on every pull request, with no path filters: a required check that
# lives in a path-filtered workflow never reports on PRs that skip it (e.g.
# docs-only changes), leaving them blocked forever.
name: Enforce all checks

on:
  pull_request:
    branches:
      - main

permissions: {}

jobs:
  enforce-all-checks:
    runs-on: ubuntu-latest
    permissions:
      checks: read
      contents: read
    steps:
      - name: GitHub Checks
        uses: poseidon/wait-for-status-checks@899c768d191b56eef585c18f8558da19e1f3e707 # v0.6.0
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          delay: 30s
          interval: 10s # default value
          timeout: 3600s # default value
          ignore: "codecov/patch,codecov/project"

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

# Aggregates the results of all other checks into a single required status check.
# It must run on every pull request, with no path filters: a required check that
# lives in a path-filtered workflow never reports on PRs that skip it (e.g.
# docs-only changes), leaving them blocked forever.
name: Enforce all checks
 
on:
  pull_request:
    branches:
      - main
 
permissions: {}
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  enforce-all-checks:
    timeout-minutes: 30
    runs-on: latchkey-small
    permissions:
      checks: read
      contents: read
    steps:
      - name: GitHub Checks
        uses: poseidon/wait-for-status-checks@899c768d191b56eef585c18f8558da19e1f3e707 # v0.6.0
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          delay: 30s
          interval: 10s # default value
          timeout: 3600s # default value
          ignore: "codecov/patch,codecov/project"
 

What changed

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.