From 5e8ff18fa80aca6772c409efff0369f7c62b7e26 Mon Sep 17 00:00:00 2001 From: Luis Augenstein Date: Tue, 31 Mar 2026 18:45:52 +0200 Subject: [PATCH] fix expand-custom-context to work again without a prefix Signed-off-by: Luis Augenstein --- .github/scripts/sbom/expand-custom-context.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/scripts/sbom/expand-custom-context.sh b/.github/scripts/sbom/expand-custom-context.sh index b354a42c..7a0a21da 100755 --- a/.github/scripts/sbom/expand-custom-context.sh +++ b/.github/scripts/sbom/expand-custom-context.sh @@ -39,8 +39,10 @@ for spdx_document in "${spdx_documents[@]}"; do # Update @context and write to file output_file="$(dirname "$spdx_document")/${output_prefix}$(basename "$spdx_document")" + tmp_output=$(mktemp) sed -f "$sed_script" "$spdx_document" | - jq --arg ctx "$spdx_context" '.["@context"] = $ctx' > "$output_file" + jq --arg ctx "$spdx_context" '.["@context"] = $ctx' > "$tmp_output" + mv "$tmp_output" "$output_file" # Clean up temporary sed script rm "$sed_script"