From 5b556ac45bb0e8ad5245f495d0e7d08bb5a0de2a Mon Sep 17 00:00:00 2001 From: Moritz Sigg Date: Sun, 8 Sep 2024 14:25:07 +0200 Subject: [PATCH] Consistently use bash -c in docker exec commands, and use single quotes instead of double quotes to prevent host side shell expansion --- .github/workflows/build_and_test.yaml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index e0a150f..d41a12f 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -49,16 +49,19 @@ jobs: docker exec \ -w ${{ env.FANS_DIR }} \ ${{ env.FANS_CONTAINER }} \ - bash -c "mkdir -p ${{ env.FANS_BUILD_DIR }}" + bash -c ' \ + mkdir -p ${{ env.FANS_BUILD_DIR }} \ + ' - name: Configure run: | docker exec \ -w ${{ env.FANS_DIR }}/${{ env.FANS_BUILD_DIR }} \ ${{ env.FANS_CONTAINER }} \ - bash -c " \ + bash -c ' \ cmake --version && \ - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .." + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. \ + ' - uses: actions/upload-artifact@v4 if: failure() @@ -81,7 +84,9 @@ jobs: docker exec \ -w ${{ env.FANS_DIR }}/${{ env.FANS_BUILD_DIR }} \ ${{ env.FANS_CONTAINER }} \ - cmake --build . -j $(nproc) || cmake --build . -j1 + bash -c ' \ + cmake --build . -j $(nproc) || cmake --build . -j1 \ + ' - name: Tests run: | @@ -89,7 +94,9 @@ jobs: -w ${{ env.FANS_DIR }}/${{ env.FANS_BUILD_DIR }} \ -e CTEST_OUTPUT_ON_FAILURE=1 \ ${{ env.FANS_CONTAINER }} \ - ctest + bash -c ' \ + ctest + ' - uses: actions/upload-artifact@v4 if: failure()