From 65ebb1a45af8dee54b6291fba5b88b34aec781f9 Mon Sep 17 00:00:00 2001 From: Adam Cmiel Date: Fri, 26 Jul 2024 11:00:22 +0200 Subject: [PATCH] gitops-pull-request: add missing when conditions When the 'gather-deploy-images' task doesn't find any images that changed between the current ref and the base branch, it returns an empty string. Skip the verify-ec and download-sbom -> upload-sbom tasks when this happens. Otherwise, those tasks would run unnecessarily and/or fail. Signed-off-by: Adam Cmiel --- .../gitops-pull-request.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pipelines/gitops-pull-request-rhtap/gitops-pull-request.yaml b/pipelines/gitops-pull-request-rhtap/gitops-pull-request.yaml index 0eed8bb390..8f35e27b57 100644 --- a/pipelines/gitops-pull-request-rhtap/gitops-pull-request.yaml +++ b/pipelines/gitops-pull-request-rhtap/gitops-pull-request.yaml @@ -88,6 +88,10 @@ spec: value: $(params.ec-tuf-mirror) runAfter: - get-images-to-verify + when: + - input: $(tasks.get-images-to-verify.results.IMAGES_TO_VERIFY) + operator: notin + values: [""] taskRef: name: verify-enterprise-contract version: "0.1" @@ -110,6 +114,10 @@ spec: - name: download-sboms runAfter: - get-images-to-upload-sbom + when: + - input: $(tasks.get-images-to-upload-sbom.results.IMAGES_TO_VERIFY) + operator: notin + values: [""] params: - name: IMAGES value: $(tasks.get-images-to-upload-sbom.results.IMAGES_TO_VERIFY) @@ -131,6 +139,10 @@ spec: - name: upload-sboms-to-trustification runAfter: - download-sboms + when: + - input: $(tasks.get-images-to-upload-sbom.results.IMAGES_TO_VERIFY) + operator: notin + values: [""] params: - name: SBOMS_DIR value: sboms