Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-actions/gcp/setup: Optionally delete existing boto config #2441

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions gh-actions/gcp/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ inputs:
boto:
type: boolean
default: true
boto-rm:
type: boolean
default: false

outputs:
key-path:
Expand All @@ -15,31 +18,42 @@ outputs:
runs:
using: "composite"
steps:
- run: |
if [[ -e "~/.boto" ]]; then
echo "Remove existing boto config ~/.boto"
rm ~/.boto
fi
if: ${{ inputs.key && inputs.boto-rm }}
shell: bash

# Install gsutil if necessary
- run: |
if ! which gsutil >& /dev/null; then
echo "installed=false" >> $GITHUB_OUTPUT
else
echo "installed=true" >> $GITHUB_OUTPUT
fi
id: gsutil
if: ${{ inputs.key }}
shell: bash

- uses: actions/setup-python@v5
if: ${{ steps.gsutil.outputs.installed != 'true' }}
if: ${{ inputs.key && steps.gsutil.outputs.installed != 'true' }}
with:
python-version: "3.12"
- if: ${{ steps.gsutil.outputs.installed != 'true' }}
- if: ${{ inputs.key && steps.gsutil.outputs.installed != 'true' }}
run: |
pip install gsutil
UTIL_PATH="$(dirname $(which gsutil))"
echo "PATH=$PATH:$UTIL_PATH" >> $GITHUB_ENV
shell: bash
- run: |
gsutil --version
if: ${{ inputs.key }}
shell: bash

- uses: envoyproxy/toolshed/gh-actions/github/script/run@826fca37548d7e2b2e39a1c01824bcd6351f8c9e
id: key
if: ${{ inputs.key }}
with:
run: |
GCP_KEY_PATH=$(mktemp -t gcp_account.XXXXXX.json)
Expand Down