You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Yaml condition using searchpattern should pass if at least one file was detected #9848
Currently a yaml condition using searchpattern fails if at least one yaml couldn't detect the specified key.
To align with the file plugin, we should only fail if none of the yaml file contain the specified key.
The goal would be to use this condition in pipelines like
conditions:
githubaction:
name: "Is Updatecli is used in a GitHub Action workflow"
kind: yaml
spec:
engine: yamlpath
files:
- ".github/workflows/*"
key: '$.jobs.*.steps[?(@.uses =~ /^updatecli\/updatecli-action/)].with.version'
keyonly: true
searchpattern: true
# {{ if .scm.enabled }}
scmid: default
I plan to align the yaml condition behavior with the file plugin: when \searchpattern: true\ and \keyonly: true\ are used, the condition should pass as long as at least one matched file contains the specified key, and only fail if none of the yaml files contain the key.
I'll update \pkg/plugins/resources/yaml/condition.go\ and add test cases covering both scenarios. Could you assign the issue to me?
Activity
junnhwan commentedon Aug 6, 2026
Hi @olblak, I'd like to work on this issue.
I plan to align the yaml condition behavior with the file plugin: when \searchpattern: true\ and \keyonly: true\ are used, the condition should pass as long as at least one matched file contains the specified key, and only fail if none of the yaml files contain the key.
I'll update \pkg/plugins/resources/yaml/condition.go\ and add test cases covering both scenarios. Could you assign the issue to me?
olblak commentedon Aug 7, 2026
This would be awesome thanks
fix(yaml): pass keyonly condition with searchpattern when at least on…