save to 0.0.2

This commit is contained in:
moweilin 2024-01-17 23:42:12 +08:00
parent 8823a4078b
commit 986fa0612a
5 changed files with 12 additions and 3 deletions

View File

@ -1,6 +1,6 @@
# action-kubernetes-login # 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 ## Inputs

View File

@ -4,7 +4,6 @@ inputs:
kubeconfig: kubeconfig:
description: 'kubeconfig text' description: 'kubeconfig text'
required: true required: true
default: ''
force: force:
description: 'force override' description: 'force override'
required: false required: false

5
dist/index.js vendored
View File

@ -26593,6 +26593,11 @@ const path = __nccwpck_require__(1017);
try { try {
// `who-to-greet` input defined in action metadata file // `who-to-greet` input defined in action metadata file
const kubeconfig = core.getInput('kubeconfig'); const kubeconfig = core.getInput('kubeconfig');
if(!kubeconfig){
throw {
message: "kubeconfig should not be empty"
}
}
const parentDir = path.join(os.homedir(),".kube") const parentDir = path.join(os.homedir(),".kube")
mkdir(parentDir,{recursive:true}) mkdir(parentDir,{recursive:true})
const configFile = path.join(parentDir,"config") const configFile = path.join(parentDir,"config")

View File

@ -1,6 +1,6 @@
{ {
"name": "action-kubernetes-login", "name": "action-kubernetes-login",
"version": "0.0.1", "version": "0.0.2",
"type": "commonjs", "type": "commonjs",
"scripts": { "scripts": {
"build": "ncc build src/index.js -o dist" "build": "ncc build src/index.js -o dist"

View File

@ -5,6 +5,11 @@ const path = require('path');
try { try {
// `who-to-greet` input defined in action metadata file // `who-to-greet` input defined in action metadata file
const kubeconfig = core.getInput('kubeconfig'); const kubeconfig = core.getInput('kubeconfig');
if(!kubeconfig){
throw {
message: "kubeconfig should not be empty"
}
}
const parentDir = path.join(os.homedir(),".kube") const parentDir = path.join(os.homedir(),".kube")
mkdir(parentDir,{recursive:true}) mkdir(parentDir,{recursive:true})
const configFile = path.join(parentDir,"config") const configFile = path.join(parentDir,"config")