Lint (pre-commit) workflow (corazawaf/coraza)
The Lint (pre-commit) workflow from corazawaf/coraza, explained and optimized by Latchkey.
A
CI health: A - excellent
Point runs-on at Latchkey and get job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Lint (pre-commit) 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)
name: Lint (pre-commit)
on:
push:
branches:
- main
paths-ignore:
- "**/*.md"
- "LICENSE"
pull_request:
branches:
- main
paths-ignore:
- "**/*.md"
- "LICENSE"
permissions: {}
concurrency:
group: lint-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
- name: Install Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
with:
go-version: 1.25.x
cache: true
- run: go run mage.go lint
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Lint (pre-commit) on: push: branches: - main paths-ignore: - "**/*.md" - "LICENSE" pull_request: branches: - main paths-ignore: - "**/*.md" - "LICENSE" permissions: {} concurrency: group: lint-${{ github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: lint: timeout-minutes: 30 runs-on: latchkey-small permissions: contents: read steps: - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6 - name: Install Go uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6 with: go-version: 1.25.x cache: true - run: go run mage.go lint
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Add a job timeout so a hung step cannot burn hours of runner time.
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.