Skip to content

Commit

Permalink
gh-actions/gcp/setup: Optionally delete existing boto config (#2441)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Northey <[email protected]>
  • Loading branch information
phlax authored Nov 11, 2024
1 parent 0094c57 commit 8ab63c2
Showing 1 changed file with 17 additions and 3 deletions.
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

0 comments on commit 8ab63c2

Please sign in to comment.