@@ -11,19 +11,33 @@ metadata:
1111spec :
1212 description : >-
1313 This task can be used to run enterprise contract checks
14+ stepTemplate :
15+ securityContext :
16+ # runAsUser is needed because the different images used in this Task run as different users. Ideally,
17+ # we'd let OpenShift do its thing and set a random UID with a common group ID for *all* containers
18+ # in the namespace, but that is currently disabled so it's wild west.
19+ runAsUser : 0
20+ env :
21+ - name : HOME
22+ value : /tekton/home
1423 steps :
1524 - name : gather-tasks
1625 image : quay.io/konflux-ci/appstudio-utils:48c311af02858e2422d6229600e9959e496ddef1@sha256:91ddd999271f65d8ec8487b10f3dd378f81aa894e11b9af4d10639fd52bba7e8
1726 # per https://kubernetes.io/docs/concepts/containers/images/#imagepullpolicy-defaulting
1827 # the cluster will set imagePullPolicy to IfNotPresent
1928 workingDir : $(workspaces.source.path)/source
2029 script : |
30+ #!/bin/bash
31+ set -euo pipefail
32+
2133 source hack/ec-checks.sh
22- $(build_tasks_dir build_tasks-ec)
23- $(all_tasks_dir all_tasks-ec)
34+
35+ build_tasks_dir build_tasks-ec
36+ all_tasks_dir all_tasks-ec
37+ stepactions_dir stepactions-ec
2438 - name : validate-all-tasks
2539 workingDir : " $(workspaces.source.path)/source"
26- image : quay.io/enterprise-contract/ec-cli:snapshot@sha256:ccbf00aee7d4af1f78ba66aa04b0899b7e770dea44f6df0a1aa0a9a12529e9fe
40+ image : quay.io/enterprise-contract/ec-cli:snapshot@sha256:46fae4d356d678383a926de8a68f79177d7e685d5497675acf41c9d3425aaacc
2741 script : |
2842 set -euo pipefail
2943
3751 ec validate input --policy "${policy}" --output yaml --strict=true ${args[*]}
3852 - name : validate-build-tasks
3953 workingDir : " $(workspaces.source.path)/source"
40- image : quay.io/enterprise-contract/ec-cli:snapshot@sha256:ccbf00aee7d4af1f78ba66aa04b0899b7e770dea44f6df0a1aa0a9a12529e9fe
54+ image : quay.io/enterprise-contract/ec-cli:snapshot@sha256:46fae4d356d678383a926de8a68f79177d7e685d5497675acf41c9d3425aaacc
4155 script : |
4256 set -euo pipefail
4357
4963 policy='./policies/build-tasks.yaml'
5064
5165 ec validate input --policy "${policy}" --output yaml --strict=true ${args[*]}
66+ - name : validate-step-actions
67+ workingDir : " $(workspaces.source.path)/source"
68+ image : quay.io/enterprise-contract/ec-cli:snapshot@sha256:46fae4d356d678383a926de8a68f79177d7e685d5497675acf41c9d3425aaacc
69+ script : |
70+ #!/bin/bash
71+ set -euo pipefail
72+
73+ # Generate array of file parameters, e.g. --file=foo.yaml --file=bar.yaml
74+ files=( stepactions-ec/*.yaml )
75+ readarray -t args < <(printf -- '--file=%s\n' "${files[@]}")
76+ echo "[DEBUG] Files parameter: ${args[*]}"
77+
78+ policy='./policies/step-actions.yaml'
79+ ec validate input --show-successes --policy "${policy}" --output yaml --strict=true "${args[@]}"
80+
5281 workspaces :
5382 - name : source
0 commit comments