Skip to content
Latchkey

Loop Readiness Audit (dogfood) workflow (cobusgreyling/loop-engineering)

The Loop Readiness Audit (dogfood) workflow from cobusgreyling/loop-engineering, 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: cobusgreyling/loop-engineering.github/workflows/audit.ymlLicense MITView source

What it does

This is the Loop Readiness Audit (dogfood) workflow from the cobusgreyling/loop-engineering 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

workflow (.yml)
name: Loop Readiness Audit (dogfood)

permissions:
  contents: read
  pull-requests: write

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  schedule:
    - cron: '17 9 * * *'

jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7

      - uses: actions/setup-node@v6
        with:
          node-version: '22'
          cache: 'npm'
          cache-dependency-path: tools/loop-audit/package-lock.json

      - name: Build, test & run loop-audit on the reference + starters
        run: bash scripts/ci-audit-gates.sh

      - name: Comment PR with loop readiness score
        if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
        continue-on-error: true
        uses: actions/github-script@v9
        with:
          script: |
            const fs = require('fs');
            let data;
            try {
              data = JSON.parse(fs.readFileSync('/tmp/audit.json', 'utf8'));
            } catch (e) {
              core.setFailed('Could not read audit JSON for PR comment');
              return;
            }
            const recs = (data.recommendations || []).slice(0, 5);
            const body = [
              '## Loop Readiness Audit',
              '',
              `**Score:** ${data.score}/100 (**${data.level}**)`,
              '',
              data.assessment,
              '',
              recs.length ? '### Top suggestions\n' + recs.map(r => `- ${r}`).join('\n') : '_No suggestions - looking good._',
              '',
              '<sub>Posted by `audit.yml` · [loop-audit docs](https://github.com/cobusgreyling/loop-engineering/tree/main/tools/loop-audit)</sub>',
            ].join('\n');
            await github.rest.issues.createComment({
              owner: context.repo.owner,
              repo: context.repo.repo,
              issue_number: context.issue.number,
              body,
            });

The same workflow, on Latchkey

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

name: Loop Readiness Audit (dogfood)
 
permissions:
  contents: read
  pull-requests: write
 
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  schedule:
    - cron: '17 9 * * *'
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  audit:
    timeout-minutes: 30
    runs-on: latchkey-small
    steps:
      - uses: actions/checkout@v7
 
      - uses: actions/setup-node@v6
        with:
          node-version: '22'
          cache: 'npm'
          cache-dependency-path: tools/loop-audit/package-lock.json
 
      - name: Build, test & run loop-audit on the reference + starters
        run: bash scripts/ci-audit-gates.sh
 
      - name: Comment PR with loop readiness score
        if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
        continue-on-error: true
        uses: actions/github-script@v9
        with:
          script: |
            const fs = require('fs');
            let data;
            try {
              data = JSON.parse(fs.readFileSync('/tmp/audit.json', 'utf8'));
            } catch (e) {
              core.setFailed('Could not read audit JSON for PR comment');
              return;
            }
            const recs = (data.recommendations || []).slice(0, 5);
            const body = [
              '## Loop Readiness Audit',
              '',
              `**Score:** ${data.score}/100 (**${data.level}**)`,
              '',
              data.assessment,
              '',
              recs.length ? '### Top suggestions\n' + recs.map(r => `- ${r}`).join('\n') : '_No suggestions - looking good._',
              '',
              '<sub>Posted by `audit.yml` · [loop-audit docs](https://github.com/cobusgreyling/loop-engineering/tree/main/tools/loop-audit)</sub>',
            ].join('\n');
            await github.rest.issues.createComment({
              owner: context.repo.owner,
              repo: context.repo.repo,
              issue_number: context.issue.number,
              body,
            });

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