Skip to content

Commit

Permalink
gitops-pull-request: add missing when conditions
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
chmeliik committed Jul 26, 2024
1 parent c22a0bb commit 65ebb1a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pipelines/gitops-pull-request-rhtap/gitops-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 65ebb1a

Please sign in to comment.