woodpecker: Linter should not report warning for missing when in steps if global when is set
Component
server
Describe the bug
Currently even if global when is set warning for each step is still shown
[bad_habit] Please set an event filter on all when branches
System Info
{"source":"https://github.com/woodpecker-ci/woodpecker","version":"next-65d88be523"}
Additional context
No response
Validations
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Checked that the bug isn’t fixed in the
nextversion already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (16 by maintainers)
yeah exactly it is configured at workflow level, not step level
Yeah, thank you it works! I badly understood, I thought
-branch: '*'was the event and I did think about the event property. Thank you a lot!Where’s the “global” (I assume workflow-level) event filter in your example?
This
whenjust filters forbranchorpath. You must do something like this:Ahhh okay my bad, I see that event needs to be first, and no indent. That wasn’t super clear in the docs, the difference between AND and OR.
There are two
whenbranches:status: [ failure ]event: pull_requestThey’re connected with OR, so the first one doesn’t have an event filter. Every
whenbranch should have an event filter.It’s not required, but it’s highly recommended as we might add new events in the feature and you probably don’t want to run a lint step if e.g. a new issue is opened.
The ui only shows a warning with the
bad_habitcategory, not an error.yes, sorry, works correctly, had typo