Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xucian committed Nov 12, 2021
1 parent 9816581 commit 5945c07
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ runs:
if: runner.os == 'macOS'
shell: bash
run: |
# Storing current dir, as gsutil needs to be ran from it
prev_working_dir="$(pwd)"
# Installing as per https://cloud.google.com/storage/docs/gsutil_install
echo "Installing in temp folder so we can simulate a docker image as much as we can (not affecting user environment too much)"
Expand All @@ -72,8 +75,9 @@ runs:
install_dir=$(mktemp -d)
tar xfz "$file_name" -C "$install_dir"
echo "Entering install dir"
cd "$install_dir"/gsutil || exit 123
gsutil_bin_dir="$install_dir"/gsutil
echo "Entering install dir: $gsutil_bin_dir"
cd "$gsutil_bin_dir" || exit 123
echo "Write key to dir"
key_path="$install_dir"/key.json
Expand Down Expand Up @@ -110,12 +114,13 @@ runs:
cmd_email="Credentials:gs_service_client_id=$email"
cmd_key="Credentials:gs_service_key_file=$inner_key_path"
echo "Exiting install dir and returning to working dir: $prev_working_dir"
cd "$prev_working_dir"
echo "Running: ${{ inputs.do }}"
./gsutil -o "$cmd_proj" -o "$cmd_email" -o "$cmd_key" ${{ inputs.do }}
"$gsutil_bin_dir"/gsutil -o "$cmd_proj" -o "$cmd_email" -o "$cmd_key" ${{ inputs.do }}
echo "Deleting the install"
# Exiting current dir to not cause troubles when deleting it
cd ../.. || true
rm -r "$install_dir"
- name: Running gsutil command if non-OSX host
Expand Down

0 comments on commit 5945c07

Please sign in to comment.