Deploy & Ops
GitHub Actions for Agent-Written Code
Use when setting up GitHub Actions CI for a repo where coding agents open PRs, so the gate catches the failure modes agents actually produce: an import of a file that was never committed, lockfile drift, and blocked dependency build scripts. Covers reproducing the deploy's install and type gate exactly, and verifying the committed tree rather than the working tree. If an agent's commit can reach main, use this skill.
1 file
Description
Use when setting up GitHub Actions CI for a repo where coding agents open PRs, so the gate catches the failure modes agents actually produce: an import of a file that was never committed, lockfile drift, and blocked dependency build scripts. Covers reproducing the deploy's install and type gate exactly, and verifying the committed tree rather than the working tree. If an agent's commit can reach main, use this skill.
name: github-actions-agent-ci description: Use when setting up GitHub Actions CI for a repo where coding agents open PRs, so the gate catches the failure modes agents produce: uncommitted imports, lockfile drift, and blocked dependency build scripts. Reproduces the deploy environment exactly.
GitHub Actions for Agent-Written Code
When to trigger
A repo where agents (or fast human iteration) push changes and you want CI to catch what passes locally but breaks the deploy, before it reaches production.
The failure agents produce most
An agent leaves an in-progress file unstaged, then commits code that imports it. Local checks pass (the file is on disk); CI checks out only the commit and fails. So the gate must test the committed tree, which a fresh checkout does by definition. Do not run checks against a dirty runner.
Reproduce the deploy environment exactly
Match the deploy's install and gate, or CI will disagree with production:
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- run: pnpm install --frozen-lockfile # surfaces lockfile drift + blocked build scripts
- run: pnpm typecheck # the SAME gate the deploy runs
- run: pnpm build
--frozen-lockfilefails on lockfile drift instead of silently updating, and surfacesERR_PNPM_IGNORED_BUILDSwhen a dependency's build script is not approved (pnpm 11 blocks them by default; the approval list isallowBuilds:inpnpm-workspace.yaml).- Run the exact type gate the deploy uses. If the deploy runs
tsc --noEmitor a native preview, run that, not justnext build, which does not fail on every type error.
Keep the gate fast and honest
- Add
pnpm lint:ox(or your fast linter) as its own quick step so a lint error is not buried in a slow build. - Cache the store (
cache: pnpm) so installs are quick; never cachenode_modulesacross lockfile changes. - Fail the job on the first real error; a green PR check should mean the deploy will build.
Pitfalls
- Running checks with
actions/checkoutplus an unpinnedpnpm install(not frozen) hides the exact drift the deploy will hit. Freeze the lockfile. next buildpassing is not proof the type gate passes. Run the gate the deploy runs.- Skipping
pnpm-workspace.yamlallowBuilds:means CI installs clean but the deploy hard-fails on ignored build scripts. Reproduce the install with--frozen-lockfileso CI catches it first.
Related
Added 2026-07-01. Back to the Skill Library.

Get Smarter About AI Dev
New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.