From 8f1db2ed50ed471ceb275ae8295d8e09741fcfb6 Mon Sep 17 00:00:00 2001 From: Adam Cmiel Date: Mon, 12 Aug 2024 16:35:31 +0200 Subject: [PATCH] download-sbom: improve tmp_dest handling - declare and assign separately to avoid masking return value (ShellCheck warning) - use a template for the tempfile name to make it identifiable when running the script locally Signed-off-by: Adam Cmiel --- .../0.1/download-sbom-from-url-in-attestation.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/task/download-sbom-from-url-in-attestation/0.1/download-sbom-from-url-in-attestation.yaml b/task/download-sbom-from-url-in-attestation/0.1/download-sbom-from-url-in-attestation.yaml index 7dfc833133..ff87acd1fa 100644 --- a/task/download-sbom-from-url-in-attestation/0.1/download-sbom-from-url-in-attestation.yaml +++ b/task/download-sbom-from-url-in-attestation/0.1/download-sbom-from-url-in-attestation.yaml @@ -205,7 +205,8 @@ spec: # -> https://registry.com/v2/namespace/repo/blobs/sha256:digest blob_url=$(sed -E 's;([^/]*)/(.*)@(.*);https://\1/v2/\2/blobs/\3;' <<< "$blob_ref") - local tmp_dest=$(mktemp --tmpdir) + local tmp_dest + tmp_dest=$(mktemp --tmpdir download-sbom-task.out.XXXXXX) local headers_file headers_file=$(mktemp --tmpdir download-sbom-task.headers.XXXXXX)