diff --git a/README.md b/README.md index a104fc8..33d0b39 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # action-kubernetes-login -This action prints "Hello World" or "Hello" + the name of a person to greet to the log. +This action create kubeconfig ## Inputs diff --git a/action.yml b/action.yml index b7d24e2..8f848f3 100644 --- a/action.yml +++ b/action.yml @@ -4,7 +4,6 @@ inputs: kubeconfig: description: 'kubeconfig text' required: true - default: '' force: description: 'force override' required: false diff --git a/dist/index.js b/dist/index.js index 1d9e17a..a59349e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -26593,6 +26593,11 @@ const path = __nccwpck_require__(1017); try { // `who-to-greet` input defined in action metadata file const kubeconfig = core.getInput('kubeconfig'); + if(!kubeconfig){ + throw { + message: "kubeconfig should not be empty" + } + } const parentDir = path.join(os.homedir(),".kube") mkdir(parentDir,{recursive:true}) const configFile = path.join(parentDir,"config") diff --git a/package.json b/package.json index aa8bfb0..174c9ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "action-kubernetes-login", - "version": "0.0.1", + "version": "0.0.2", "type": "commonjs", "scripts": { "build": "ncc build src/index.js -o dist" diff --git a/src/index.js b/src/index.js index 8a54606..97ea55f 100644 --- a/src/index.js +++ b/src/index.js @@ -5,6 +5,11 @@ const path = require('path'); try { // `who-to-greet` input defined in action metadata file const kubeconfig = core.getInput('kubeconfig'); + if(!kubeconfig){ + throw { + message: "kubeconfig should not be empty" + } + } const parentDir = path.join(os.homedir(),".kube") mkdir(parentDir,{recursive:true}) const configFile = path.join(parentDir,"config")