diff --git a/action.yml b/action.yml index 3d91980..3c6ad79 100644 --- a/action.yml +++ b/action.yml @@ -33,15 +33,23 @@ runs: using: "composite" steps: - run: | - cd /usr/local && { \ + # Fallback to /usr/local for backwards compatability + prefix_dir="${RUNNER_TEMP:-/usr/local}" + # Ensure the dir is writable otherwise fallback to tmpdir + if [[ ! -d "$prefix_dir" ]] || [[ ! -w "$prefix_dir" ]]; then + prefix_dir="$(mktemp -d)" + fi + printf '%s/bin' "$prefix_dir" >> $GITHUB_PATH + # The install.sh script creates path ${prefix_dir}/bin + cd "$prefix_dir" && { \ curl -sL https://dl.dagger.io/dagger/install.sh 2>/dev/null | \ - DAGGER_VERSION=${{ inputs.version }} sh 2>/dev/null; } + DAGGER_VERSION=${{ inputs.version }} sh; } shell: bash - run: | cd ${{ inputs.workdir }} && { \ DAGGER_CLOUD_TOKEN=${{ inputs.cloud-token }} \ - /usr/local/bin/dagger \ + dagger \ ${{ inputs.dagger-flags }} \ ${{ inputs.verb }} \ ${INPUT_MODULE:+-m $INPUT_MODULE} \ @@ -50,6 +58,8 @@ runs: env: INPUT_MODULE: ${{ inputs.module }} - - run: docker stop -t 300 $(docker ps --filter name="dagger-engine-*" -q) + - run: | + mapfile -t containers < <(docker ps --filter name="dagger-engine-*" -q) + docker stop -t 300 "${containers[@]}" shell: bash if: ${{ always() }}