autofix.ci workflow (louislam/uptime-kuma)
The autofix.ci workflow from louislam/uptime-kuma, explained and optimized by Latchkey.
CI health: D - needs work
Point runs-on at Latchkey and get caching, run de-duplication, job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the autofix.ci workflow from the louislam/uptime-kuma 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
name: autofix.ci
on:
push:
branches: ["master", "1.23.X"]
pull_request:
permissions: {}
jobs:
autofix:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with: { persist-credentials: false }
# Tempoary disable until we understand TanStack npm supply-chain compromise
# - name: Cache/Restore node_modules
# uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
# id: node-modules-cache
# with:
# path: node_modules
# key: node-modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: Setup Node.js
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Auto-fix JavaScript/Vue linting issues
run: npm run lint-fix:js
continue-on-error: true
- name: Auto-fix CSS/SCSS linting issues
run: npm run lint-fix:style
continue-on-error: true
- name: Auto-format code with Prettier
run: npm run fmt
continue-on-error: true
- name: Compile TypeScript
run: npm run tsc
continue-on-error: true
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
The same workflow, on Latchkey
Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.
name: autofix.ci on: push: branches: ["master", "1.23.X"] pull_request: permissions: {} concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: autofix: timeout-minutes: 30 runs-on: latchkey-small permissions: contents: read steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: { persist-credentials: false } # Tempoary disable until we understand TanStack npm supply-chain compromise # - name: Cache/Restore node_modules # uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 # id: node-modules-cache # with: # path: node_modules # key: node-modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} - name: Setup Node.js uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: cache: 'npm' node-version: 20 - name: Install dependencies run: npm ci - name: Auto-fix JavaScript/Vue linting issues run: npm run lint-fix:js continue-on-error: true - name: Auto-fix CSS/SCSS linting issues run: npm run lint-fix:style continue-on-error: true - name: Auto-format code with Prettier run: npm run fmt continue-on-error: true - name: Compile TypeScript run: npm run tsc continue-on-error: true - uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
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. - Cancel superseded runs when a branch or PR gets a newer push.
- Cache dependency installs on the setup step so they are served from cache.
- Add a job timeout so a hung step cannot burn hours of runner time.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Dependency installs
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.