From 751bf1c396a6dc91a52ea9ec5b85b17209f4b66f Mon Sep 17 00:00:00 2001 From: reachableceo Date: Wed, 2 Sep 2026 22:30:16 -0500 Subject: [PATCH] fix(deploy): self-diagnosing sha sensor + drop invalid not-key [#734] Gitea response came back a dict (error body) - sensor state now shows the truncated body so one restart identifies it. not: rejected by trigger schema; guard lives in the condition template already. Detail: https://projects.knownelement.com/issues/734 --- automations.yaml | 3 --- packages/deploy_pipeline.yaml | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/automations.yaml b/automations.yaml index f2e9202..2629f16 100644 --- a/automations.yaml +++ b/automations.yaml @@ -332,9 +332,6 @@ triggers: - trigger: state entity_id: sensor.pfv_deploy_gitea_master_head - not: - - unknown - - unavailable conditions: - condition: template value_template: >- diff --git a/packages/deploy_pipeline.yaml b/packages/deploy_pipeline.yaml index a15be7b..278543b 100644 --- a/packages/deploy_pipeline.yaml +++ b/packages/deploy_pipeline.yaml @@ -15,5 +15,5 @@ rest: sensor: - name: PFV deploy gitea master head unique_id: pfv_deploy_gitea_master_head - availability: "{{ value_json is defined and value_json | length > 0 }}" - value_template: "{{ value_json[0].sha }}" + availability: "{{ value_json is defined and value_json is list and value_json | length > 0 }}" + value_template: "{{ value_json[0].sha if value_json is list and value_json | length > 0 else (value_json | string | truncate(90)) }}"