Skip to content
Latchkey

Publish goal-audit (bootstrap) workflow (cobusgreyling/loop-engineering)

The Publish goal-audit (bootstrap) workflow from cobusgreyling/loop-engineering, 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: cobusgreyling/loop-engineering.github/workflows/publish-goal-audit-bootstrap.ymlLicense MITView source

What it does

This is the Publish goal-audit (bootstrap) 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: Publish goal-audit (bootstrap)

# One-time bootstrap: publishes @cobusgreyling/goal-audit from goal-engineering
# using this repo's NPM_TOKEN. After first publish, use goal-engineering's
# release-goal-audit.yml tag workflow (copy NPM_TOKEN to that repo).

on:
  workflow_dispatch:

permissions:
  contents: read
  id-token: write

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
        with:
          repository: cobusgreyling/goal-engineering
          ref: main

      - uses: actions/setup-node@v6
        with:
          node-version: '22'
          registry-url: 'https://registry.npmjs.org'
          cache: 'npm'
          cache-dependency-path: tools/goal-audit/package-lock.json

      - name: Install, build, test
        working-directory: tools/goal-audit
        run: |
          npm ci
          npm run build
          npm test

      - name: Publish to npm
        working-directory: tools/goal-audit
        run: npm publish --access public
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

The same workflow, on Latchkey

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

name: Publish goal-audit (bootstrap)
 
# One-time bootstrap: publishes @cobusgreyling/goal-audit from goal-engineering
# using this repo's NPM_TOKEN. After first publish, use goal-engineering's
# release-goal-audit.yml tag workflow (copy NPM_TOKEN to that repo).
 
on:
  workflow_dispatch:
 
permissions:
  contents: read
  id-token: write
 
jobs:
  publish:
    timeout-minutes: 30
    runs-on: latchkey-small
    steps:
      - uses: actions/checkout@v7
        with:
          repository: cobusgreyling/goal-engineering
          ref: main
 
      - uses: actions/setup-node@v6
        with:
          node-version: '22'
          registry-url: 'https://registry.npmjs.org'
          cache: 'npm'
          cache-dependency-path: tools/goal-audit/package-lock.json
 
      - name: Install, build, test
        working-directory: tools/goal-audit
        run: |
          npm ci
          npm run build
          npm test
 
      - name: Publish to npm
        working-directory: tools/goal-audit
        run: npm publish --access public
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

What changed

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:

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