From a0d62587ded78bc4c0dec172cc74d32d506e4e82 Mon Sep 17 00:00:00 2001 From: aarbit Date: Tue, 29 Sep 2026 15:52:35 -0500 Subject: [PATCH] Add explicit event filters to install/lint/typecheck steps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Woodpecker's linter flags steps with no event filter as a "bad habit" (they'd otherwise run on every event type, including ones added to Woodpecker in the future). Scoped to [push, deployment] specifically — not just push — since a production deploy re-runs the whole pipeline as a deployment event, and deploy-production's build needs these steps (especially install's node_modules) to have actually run first. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_017DUU6CnxECCDeqDNYJgr5x --- .woodpecker.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index 59c2163..12ee60b 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -14,18 +14,29 @@ # `npm ci` in the install step is enough for every later step to reuse. steps: + # Explicit event filter on these three (rather than the no-`when` default, + # which runs on every event Woodpecker knows about) because a deploy-time + # re-run of this pipeline is a `deployment` event, not `push` — install + # has to fire there too, or deploy-production's `npm run build` would run + # with no node_modules. - name: install image: node:22-bookworm + when: + - event: [push, deployment] commands: - npm ci - name: lint image: node:22-bookworm + when: + - event: [push, deployment] commands: - npm run lint - name: typecheck image: node:22-bookworm + when: + - event: [push, deployment] commands: - npx tsc -b