Skip to main content
Version: 2.6.x ๐Ÿ’€

Linter

Woodpecker automatically lints your workflow files for errors, deprecations and bad habits. Errors and warnings are shown in the UI for any pipelines.

errors and warnings in UI

Running the linter from CLIโ€‹

You can run the linter also manually from the CLI:

woodpecker-cli lint <workflow files>

Bad habit warningsโ€‹

Woodpecker warns you if your configuration contains some bad habits.

Event filter for all stepsโ€‹

All your items in when blocks should have an event filter, so no step runs on all events. This is recommended because if new events are added, your steps probably shouldn't run on those as well.

Examples of an incorrect config for this rule:

when:
- branch: main
- event: tag

This will trigger the warning because the first item (branch: main) does not filter with an event.

steps:
- name: test
when:
branch: main

- name: deploy
when:
event: tag

Examples of a correct config for this rule:

when:
- branch: main
event: push
- event: tag
steps:
- name: test
when:
event: [tag, push]

- name: deploy
when:
- event: tag