constellation/.github/actions/login_gcp/action.yml
renovate[bot] a8101c8c64
deps: update GitHub action dependencies (#1745)
Co-authored-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
2023-05-05 14:42:20 +02:00

33 lines
1.4 KiB
YAML

name: GCP login
description: "Login to GCP & configure gcloud CLI."
inputs:
service_account:
description: "GCP service account name. Format: <account-name>@<project-name>.iam.gserviceaccount.com"
required: true
runs:
using: "composite"
steps:
- name: Clean env to prevent warnings
shell: bash
run: |
echo "CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE=" >> "$GITHUB_ENV"
echo "GOOGLE_APPLICATION_CREDENTIALS=" >> "$GITHUB_ENV"
echo "GOOGLE_GHA_CREDS_PATH=" >> "$GITHUB_ENV"
echo "CLOUDSDK_CORE_PROJECT=" >> "$GITHUB_ENV"
echo "CLOUDSDK_PROJECT=" >> "$GITHUB_ENV"
echo "GCLOUD_PROJECT=" >> "$GITHUB_ENV"
echo "GCP_PROJECT=" >> "$GITHUB_ENV"
echo "GOOGLE_CLOUD_PROJECT=" >> "$GITHUB_ENV"
# As described at:
# https://github.com/google-github-actions/setup-gcloud#service-account-key-json
- name: Authorize GCP access
uses: google-github-actions/auth@e8df18b60c5dd38ba618c121b779307266153fbf # v1.1.0
with:
workload_identity_provider: projects/796962942582/locations/global/workloadIdentityPools/constellation-ci-pool/providers/constellation-ci-provider
service_account: ${{ inputs.service_account }}
# Even if preinstalled in Github Actions runner image, this setup does some magic authentication required for gsutil.
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@62d4898025f6041e16b1068643bfc5a696863587 # v1.1.0