From 2f70fef663b1143bf50d461680c6ac4a97b73af3 Mon Sep 17 00:00:00 2001 From: Ramon Petgrave <32398091+ramonpetgrave64@users.noreply.github.com> Date: Thu, 27 Jun 2024 13:22:49 -0400 Subject: [PATCH] fix: make download-artifacts.sh more flexible (#761) Making the `download-artifacts.sh` script be more useful. Before, it would error upon seeing some zip files that it doesn't expect to be in the GH release. I think the script is just a bit outdated. But for now, I think we should bypass that, since the script is already written to know which of the final files within the archives are actually needed. related PR https://github.com/slsa-framework/slsa-github-generator/pull/3589 Signed-off-by: Ramon Petgrave --- download-artifacts.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/download-artifacts.sh b/download-artifacts.sh index e5e218e..f8e3fff 100644 --- a/download-artifacts.sh +++ b/download-artifacts.sh @@ -88,6 +88,13 @@ unzip_files() { rm -rf "${tmp_dir}" ;; + # catch-all for any zip file + # TODO: With the commands at the end of this script, only the needed files will be copied over. + # But we should get specific about which files to ignore. + ./*.zip) + unzip -o "${zip_path}" -d "${output_path}" + ;; + *) echo "unexpected file path: ${zip_path}" exit 1 @@ -183,4 +190,4 @@ copy_files "gha_delegator-binary-linux-amd64-" "${repo_path}/cli/slsa-verifier/t # Maven builder copy_files "gha_maven-binary-linux-amd64-" "${repo_path}/cli/slsa-verifier/testdata/gha_maven/${version}" # gradle builder -copy_files "gha_gradle-binary-linux-amd64-" "${repo_path}/cli/slsa-verifier/testdata/gha_gradle/${version}" \ No newline at end of file +copy_files "gha_gradle-binary-linux-amd64-" "${repo_path}/cli/slsa-verifier/testdata/gha_gradle/${version}"