From 45b7d2cfac0e2ac256d458c7466a925b0a94de35 Mon Sep 17 00:00:00 2001 From: Ryan Foster Date: Wed, 4 Sep 2024 20:44:06 -0400 Subject: [PATCH] CI: Ensure finding no pattern match results in an empty string If no pattern match is found, which we expect for Qt x86 builds, then return an empty string by enabling the nullglob option. Additionally, add quotes for paths for safety and fix the for loop array syntax. --- .github/workflows/main.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index ae9b188d1..e98f49be3 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -607,6 +607,7 @@ jobs: run: | : Package Windows dependencies shopt -s extglob + shopt -s nullglob for arch in x64 x86; do _temp=$(mktemp -d) @@ -624,8 +625,8 @@ jobs: mv windows-deps-${{ steps.metadata.outputs.version }}-${arch}.zip ${GITHUB_WORKSPACE} files=("${GITHUB_WORKSPACE}"/qt6-windows-"${arch}"-!(*-@(Debug|RelWithDebInfo|Release|MinSizeRel))/*.zip) - for artifact in ${files}; do - mv ${artifact} ${GITHUB_WORKSPACE} + for artifact in "${files[@]}"; do + mv "${artifact}" "${GITHUB_WORKSPACE}" done popd > /dev/null done