k8s-set-context/action.yml
Betsy George 0fc754ad67
Some checks failed
CodeQL Advanced / Analyze (javascript-typescript) (push) Failing after 11s
Run Integration Tests / kubeconfig-method-integration-test (push) Failing after 6s
Run Prettify / Prettier Check (push) Failing after 2s
Run Unit Tests / unit-test (push) Failing after 2s
#146 Adding optional kubeconfig encoding variable (#164)
* encoding input variable added

* encoding input variable added

* encoding input variable added

* corrected unit tests

* corrected unit tests

* prettier edits

* working on tests

* working on tests

* working on tests

* minor edits

* minor edits

* better logic structure

* added tests for edge cases

* edited to enum
2025-07-17 12:27:04 -06:00

43 lines
1.6 KiB
YAML

name: 'Kubernetes Set Context'
description: 'Set the context of a target Kubernetes cluster and export the kubeconfig which is used by subsequent actions'
inputs:
# Please ensure you have used azure/login in the workflow before this action
cluster-type:
description: 'Acceptable values: generic or arc'
required: true
default: 'generic'
method:
description: 'Acceptable values: kubeconfig or service-account or service-principal'
required: true
default: 'kubeconfig'
kubeconfig:
description: 'Contents of kubeconfig file'
required: false
kubeconfig-encoding:
description: 'Encoding of the kubeconfig input. Accepts "plaintext" (default) or "base64".'
required: false
default: 'plaintext'
context:
description: 'If your kubeconfig has multiple contexts, use this field to use a specific context, otherwise the default one would be chosen'
required: false
k8s-url:
description: 'Cluster Url'
required: false
k8s-secret:
description: 'Service account secret (run kubectl get serviceaccounts <service-account-name> -o yaml and copy the service-account-secret-name)'
required: false
token:
description: 'Token extracted from the secret of service account (should be base 64 decoded)'
required: false
resource-group:
description: 'Azure resource group name'
required: false
cluster-name:
description: 'Azure connected cluster name'
required: false
branding:
color: 'blue'
runs:
using: 'node20'
main: 'lib/index.js'