Skip to content

Commit

Permalink
5
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlovesgithub committed Jul 15, 2024
1 parent 0117863 commit 763f965
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/test-gcp-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ jobs:

- name: Verify Secrets
run: |
echo "${{ secrets.TEST_VAL }}"
echo "${{ secrets.TEST_ACTIONS_SECRET }}"
echo "env level ${{ secrets.TEST_VAL }}"
echo "org level ${{ secrets.TEST_ACTIONS_SECRET }}"
# if [ -z "${{ secrets.GCP_PROJECT_NUMBER }}" ]; then echo "GCP_PROJECT_NUMBER is not set"; exit 1; else echo "GCP_PROJECT_NUMBER is set"; fi
# if [ -z "${{ secrets.GCP_POOL_ID }}" ]; then echo "GCP_POOL_ID is not set"; exit 1; else echo "GCP_POOL_ID is set"; fi
# if [ -z "${{ secrets.OIDC_PROVIDER_ID }}" ]; then echo "OIDC_PROVIDER_ID is not set"; exit 1; else echo "OIDC_PROVIDER_ID is set"; fi
# if [ -z "${{ secrets.GCP_OIDC_SERVICE_ACCOUNT_EMAIL }}" ]; then echo "GCP_OIDC_SERVICE_ACCOUNT_EMAIL is not set"; exit 1; else echo "GCP_OIDC_SERVICE_ACCOUNT_EMAIL is set"; fi
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v1
with:
workload_identity_provider: "projects/${{ secrets.GCP_PROJECT_NUMBER }}/locations/global/workloadIdentityPools/${{ secrets.GCP_POOL_ID }}/providers/${{ secrets.OIDC_PROVIDER_ID }}"
service_account: "${{ secrets.GCP_OIDC_SERVICE_ACCOUNT_EMAIL }}"
# - name: Authenticate to Google Cloud
# id: auth
# uses: google-github-actions/auth@v1
# with:
# workload_identity_provider: "projects/${{ secrets.GCP_PROJECT_NUMBER }}/locations/global/workloadIdentityPools/${{ secrets.GCP_POOL_ID }}/providers/${{ secrets.OIDC_PROVIDER_ID }}"
# service_account: "${{ secrets.GCP_OIDC_SERVICE_ACCOUNT_EMAIL }}"

- name: Test authentication
run: |
gcloud auth list
gcloud projects list
# - name: Test authentication
# run: |
# gcloud auth list
# gcloud projects list

0 comments on commit 763f965

Please sign in to comment.