From 54e2b4a6fbb834c4e20c8c5607032cf75b263bf4 Mon Sep 17 00:00:00 2001 From: Hook25 Date: Wed, 2 Oct 2024 10:30:17 +0200 Subject: [PATCH] Check the copy path before copying --- .github/actions/checkbox_source_deb/action.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/actions/checkbox_source_deb/action.yaml b/.github/actions/checkbox_source_deb/action.yaml index 31fd3c06be..698e7a2b01 100644 --- a/.github/actions/checkbox_source_deb/action.yaml +++ b/.github/actions/checkbox_source_deb/action.yaml @@ -61,10 +61,21 @@ runs: echo "::group::Dumping launcher overrides" echo "$INPUT_LAUNCHER_OVERRIDE" | tee launcher_override.conf echo "::endgroup::" - - name: Grosshack + - name: Workaroud cwd shell: bash run: | - mv ${{ github.action_path }}/../../../tools/ . + # this allows us to dispatch the action and the attachments with relative + # paths even when called form outside the Checkbox repo + action_path=$(realpath ${{ github.action_path }}/../../../tools/) + workdir_path=$(./tools) + if [ ! -e "$workdir_path" ]; then + cp -rT "$action_path" "$workdir_path" + fi + if [ "$action_path" = "$workdir_path" ]; then + echo "Skipping copy as the action is already running in workdir" + else + cp -rT "$action_path" "$workdir_path" + fi - name: Submit and monitor job uses: canonical/testflinger/.github/actions/submit@main with: