Skip to content

Commit

Permalink
Add skip-authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
baksetercx committed Oct 25, 2024
1 parent d24cd8b commit 6954eb5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ inputs:
description: 'Slack channel to notify on failure. Leave empty to disable notifications.'
required: false
default: ''
skip-authentication:
description: 'If `true`, the action will skip authentication with the cloud provider.'
required: false
default: 'false'
AZURE_CLIENT_ID:
description: 'Client ID of a service principal that has access to AKS. Only required for deploying to AKS.'
required: false
Expand Down Expand Up @@ -92,7 +96,7 @@ runs:
- name: Get federated token for Azure
shell: bash
id: get-federated-token
if: ${{ inputs.runtime-cloud-provider == 'AKS' }}
if: ${{ inputs.runtime-cloud-provider == 'AKS' && inputs.skip-authentication == 'false' }}
run: |
# Get federated token for Azure
token=$(curl -s -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" | jq -r '.value')
Expand All @@ -109,7 +113,7 @@ runs:

- name: Authenticate with Google Cloud
uses: google-github-actions/[email protected]
if: ${{ inputs.runtime-cloud-provider == 'GKE' }}
if: ${{ inputs.runtime-cloud-provider == 'GKE' && inputs.skip-authentication == 'false' }}
with:
workload_identity_provider: ${{ inputs.GC_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ inputs.GC_SERVICE_ACCOUNT }}
Expand Down

0 comments on commit 6954eb5

Please sign in to comment.