Auth GCP WIF to Akeyless Test #20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Aviv_Akeyless_GCP_WIF | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| fetch_secrets: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| # 1. Exchange GitHub OIDC for a GCP ID Token | |
| - id: 'auth' | |
| name: 'Authenticate to Google Cloud' | |
| uses: 'google-github-actions/auth@v2' | |
| with: | |
| token_format: 'id_token' | |
| id_token_audience: 'akeyless.io' | |
| id_token_include_email: true | |
| workload_identity_provider: "projects/365490161070/locations/global/workloadIdentityPools/github-pool/providers/github-provider" | |
| service_account: "akeyless-wif-sa@customer-success-391112.iam.gserviceaccount.com" | |
| # 2. Use the GCP Token to fetch secrets via Akeyless WIF (v1.1.5) | |
| - name: Fetch static secrets from Akeyless | |
| uses: akeyless-community/akeyless-github-action@v1.1.5 | |
| id: fetch-secrets | |
| with: | |
| access-id: "p-l8591cz9gcpzgm" | |
| access-type: gcp | |
| api-url: "https://api.akeyless.io" | |
| gcp-audience: 'akeyless.io' | |
| static-secrets: | | |
| - name: "/Cloud/GCP/gcp_iam_wif/static_secret" | |
| output-name: "my_secret" | |
| # 3. Use Akeyless secret (Exact run step from your request) | |
| - name: Use Akeyless secret | |
| run: | | |
| echo "Step Outputs" | |
| echo "my_first_secret: ${{ steps.fetch-secrets.outputs.my_first_secret }}" >> secrets.txt | |
| echo "Environment Variables" | |
| echo "my_first_secret: ${{ env.my_first_secret }}" >> secrets.txt |