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
I'm trying to get the use of this action to fail instead of pass when no hosts were updated. This can happen for various reasons but I don't want my CI to think the changes were actually deployed when no hosts were found from the inventory file.
This could also just be a configuration file to avoid introducing a breaking change.
Alternatively, I've tried to store the output of this action and grep it for no hosts matched but the issue is I need this action to write to GITHUB a output var. I can't just read the stdout of a step.
The text was updated successfully, but these errors were encountered:
I've worked around the warning not causing a fail in this action by adding the following step to my playbook which makes a step fail.
- name: Check if host group is empty
hosts: localhost
any_errors_fatal: true
gather_facts: no
tasks:
- name: Fail if hosts group is empty
fail:
msg: "Inventory for 'proxy' is empty. Exiting playbook."
when: "'proxy' not in groups or (groups['proxy'] | length == 0)"
This is just undesirable since I have over 30 playbooks I'll need to add this to and continue to add this to new playbooks so I hope you consider adding a configurable fatal error on warn for no hosts matched.
I'm trying to get the use of this action to fail instead of pass when no hosts were updated. This can happen for various reasons but I don't want my CI to think the changes were actually deployed when no hosts were found from the inventory file.
This could also just be a configuration file to avoid introducing a breaking change.
Alternatively, I've tried to store the output of this action and grep it for
no hosts matched
but the issue is I need this action to write to GITHUB a output var. I can't just read the stdout of a step.The text was updated successfully, but these errors were encountered: