Lint Code Base workflow (BretFisher/udemy-docker-mastery)
The Lint Code Base workflow from BretFisher/udemy-docker-mastery, explained and optimized by Latchkey.
CI health: C - fair
Run this on Latchkey for self-healing, caching, and up to 58% lower cost.
Grade your own workflow free or run it on Latchkey →What it does
This is the Lint Code Base workflow from the BretFisher/udemy-docker-mastery repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
---
# template source: https://github.com/bretfisher/super-linter-workflow/blob/main/templates/call-super-linter.yaml
name: Lint Code Base
on:
pull_request:
jobs:
call-super-linter:
name: Call Super-Linter
permissions:
contents: read # clone the repo to lint
pull-requests: write # create a summary comment in PR
statuses: write #read/write to repo custom statuses
### use Reusable Workflows to call my workflow remotely
### https://docs.github.com/en/actions/learn-github-actions/reusing-workflows
### you can also call workflows from inside the same repo via file path
# NOTE: zizmor scanner rule ignore added because we control sha pins via reusable workflow, not calling workflow
uses: bretfisher/super-linter-workflow/.github/workflows/reusable-super-linter.yaml@main # zizmor: ignore[unpinned-uses]
### Optional settings examples
with:
### A regex to exclude files from linting
### defaults to empty
filter-regex-exclude: .*compose-sample-3/html/.*,.*dockerfile-sample-5/.*
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
--- # template source: https://github.com/bretfisher/super-linter-workflow/blob/main/templates/call-super-linter.yaml name: Lint Code Base on: pull_request: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: call-super-linter: timeout-minutes: 30 name: Call Super-Linter permissions: contents: read # clone the repo to lint pull-requests: write # create a summary comment in PR statuses: write #read/write to repo custom statuses ### use Reusable Workflows to call my workflow remotely ### https://docs.github.com/en/actions/learn-github-actions/reusing-workflows ### you can also call workflows from inside the same repo via file path # NOTE: zizmor scanner rule ignore added because we control sha pins via reusable workflow, not calling workflow uses: bretfisher/super-linter-workflow/.github/workflows/reusable-super-linter.yaml@main # zizmor: ignore[unpinned-uses] ### Optional settings examples with: ### A regex to exclude files from linting ### defaults to empty filter-regex-exclude: .*compose-sample-3/html/.*,.*dockerfile-sample-5/.*
What changed
- Cancel superseded runs when a branch or PR gets a newer push.
- Add a job timeout so a hung step cannot burn hours of runner time.
1 third-party action is referenced by a movable tag. Pin it to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.