name: "Setup kubeconfig file"
description: setup a kubeconfig file using standard env variables
# All the input variables come from standard env variables that are set by a previous step that
# looks them up from vault
#inputs:
runs:
  using: "composite"
  steps:
    - shell: bash
      name: Setup KubeConfig file
      run: |
        set -x
        kubectl config set-cluster cicd --server ${K8S_ENDPOINT}
        kubectl config set clusters.cicd.certificate-authority-data ${K8S_CA_DATA}
        kubectl config set-credentials cicd --token ${K8S_TOKEN}
        kubectl config set-context cicd --cluster=cicd --user=cicd
        kubectl config set current-context cicd
