Add explicit event filters to install/lint/typecheck steps
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017DUU6CnxECCDeqDNYJgr5x
This commit is contained in:
@@ -14,18 +14,29 @@
|
|||||||
# `npm ci` in the install step is enough for every later step to reuse.
|
# `npm ci` in the install step is enough for every later step to reuse.
|
||||||
|
|
||||||
steps:
|
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
|
- name: install
|
||||||
image: node:22-bookworm
|
image: node:22-bookworm
|
||||||
|
when:
|
||||||
|
- event: [push, deployment]
|
||||||
commands:
|
commands:
|
||||||
- npm ci
|
- npm ci
|
||||||
|
|
||||||
- name: lint
|
- name: lint
|
||||||
image: node:22-bookworm
|
image: node:22-bookworm
|
||||||
|
when:
|
||||||
|
- event: [push, deployment]
|
||||||
commands:
|
commands:
|
||||||
- npm run lint
|
- npm run lint
|
||||||
|
|
||||||
- name: typecheck
|
- name: typecheck
|
||||||
image: node:22-bookworm
|
image: node:22-bookworm
|
||||||
|
when:
|
||||||
|
- event: [push, deployment]
|
||||||
commands:
|
commands:
|
||||||
- npx tsc -b
|
- npx tsc -b
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user