Skip to content
Latchkey

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.

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

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

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

Actions used in this workflow