~/VibeHandbook
$39

Chapter 15 · 07

CI basics: make the checks automatic

(Continuous Integration) is a robot that runs your checks every time you push code, so you can't forget to run them. Most platforms make this a single file. Here's a minimal GitHub Actions example:

# .github/workflows/ci.yml
name: CI
on: [push, pull_request]

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npm run lint
      - run: npm run typecheck
      - run: npm test

Now every push gets linted, type-checked, and tested automatically. If anything fails, you see a red mark before the code can be merged. You can even ask the AI to write this file for your stack — "Add a GitHub Actions workflow that runs our lint, type check, and tests on every ."

With protection turned on, a red check doesn't just warn you — it physically locks the merge button until the build is green again:

   pull request
        │
        ▼
   ┌──────────────┐      all pass        ┌───────────────┐
   │ CI runs      │ ───── ✓ green ─────▶ │ MERGE allowed │ ──▶ main
   │ lint · types │                      └───────────────┘
   │ · tests      │      any fail
   └──────────────┘ ───── ✗ red ──────▶  ┌───────────────┐
                                          │ MERGE blocked │  🔒
                                          └───────────────┘
                                          fix, push, re-run

The point of CI isn't the automation for its own sake — it's that it moves the checks off your memory and into the pipeline, where they can't be skipped on a tired night. Two upgrades are worth making once the basics run green. First, turn the checks into a required status on your main branch (a "branch protection rule" on GitHub) so a red build literally blocks the merge button instead of just showing a warning you can ignore. Second, when CI fails, paste the failing log straight to the AI: "CI failed on this run, here's the output — diagnose and fix it." The log is a precise, machine-generated bug report, which is exactly the kind of input the AI is best at acting on.

Want it offline?

Get the PDF + EPUB + downloadable prompt library + version updates.

$ Get the PDF — $39