Skip to content

Commit

Permalink
sast-coverity-check: rename the workspace to source
Browse files Browse the repository at this point in the history
... to make the interface compatible with the `build-container` task
  • Loading branch information
kdudka committed Nov 26, 2024
1 parent d10dab2 commit 234a4e1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions task/sast-coverity-check/0.2/sast-coverity-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ spec:
cpu: "16"
# per https://kubernetes.io/docs/concepts/containers/images/#imagepullpolicy-defaulting
# the cluster will set imagePullPolicy to IfNotPresent
workingDir: $(workspaces.workspace.path)/hacbs/$(context.task.name)
workingDir: $(workspaces.source.path)/hacbs/$(context.task.name)
volumeMounts:
- name: cov-license
mountPath: "/etc/secrets/cov"
Expand Down Expand Up @@ -130,9 +130,9 @@ spec:
echo "The PROJECT_NAME used is: ${PROJECT_NAME}"
COVERITY_DIR=/var/tmp/coverity/idir
COVERITY_RESULTS_FILE=$(workspaces.workspace.path)/coverity-buildless-results.json
COVERITY_RESULTS_FILE=$(workspaces.source.path)/coverity-buildless-results.json
COV_LICENSE_PATH=/etc/secrets/cov/cov-license
SOURCE_CODE_DIR=$(workspaces.workspace.path)
SOURCE_CODE_DIR=$(workspaces.source.path)
# Installing Coverity license
cp "$COV_LICENSE_PATH" /opt/coverity/bin/license.dat
Expand Down Expand Up @@ -227,23 +227,23 @@ spec:
(set -x $$ csgrep --mode=evtstat filtered_sast_coverity_buildless_check_all_findings.json)
fi
csgrep --mode=sarif filtered_sast_coverity_buildless_check_all_findings.json > "$(workspaces.workspace.path)"/coverity-results.sarif
csgrep --mode=sarif filtered_sast_coverity_buildless_check_all_findings.json > "$(workspaces.source.path)"/coverity-results.sarif
if [[ -z "$(csgrep --mode=evtstat filtered_sast_coverity_buildless_check_all_findings.json)" ]]; then
note="Task $(context.task.name) success: No finding was detected"
ERROR_OUTPUT=$(make_result_json -r SUCCESS -t "$note")
echo "${ERROR_OUTPUT}" | tee "$(results.TEST_OUTPUT.path)"
else
TEST_OUTPUT=
parse_test_output "$(context.task.name)" sarif "$(workspaces.workspace.path)"/coverity-results.sarif || true
parse_test_output "$(context.task.name)" sarif "$(workspaces.source.path)"/coverity-results.sarif || true
note="Task $(context.task.name) failed: For details, check Tekton task log."
echo "${ERROR_OUTPUT}" | tee "$(results.TEST_OUTPUT.path)"
fi
echo "${TEST_OUTPUT:-${ERROR_OUTPUT}}" | tee "$(results.TEST_OUTPUT.path)"
- name: upload
image: quay.io/konflux-ci/oras:latest@sha256:99737f436051e6d3866eb8a8706463c35abf72c87f05090ff42ff642f6729661
workingDir: $(workspaces.workspace.path)
workingDir: $(workspaces.source.path)
env:
- name: IMAGE_URL
value: $(params.image-url)
Expand Down Expand Up @@ -273,4 +273,4 @@ spec:
oras attach --no-tty --registry-config "$HOME/auth.json" --artifact-type "${MEDIA_TYPE}" "${IMAGE_URL}" "${UPLOAD_FILE}:${MEDIA_TYPE}"
done
workspaces:
- name: workspace
- name: source

0 comments on commit 234a4e1

Please sign in to comment.