2 Commits

Author SHA1 Message Date
Aarnav Tale
8c4badf72a chore: v1.1.2 2023-01-25 11:18:36 -05:00
Aarnav Tale
ff8bf47b42 feat: actually execute post action 2023-01-25 11:17:31 -05:00
2 changed files with 11 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "kubectl-action",
"version": "1.1.1",
"version": "1.1.2",
"scripts": {
"dev": "ncc -smw --license licenses.txt build src/main.ts",
"build": "ncc -sm --license licenses.txt build src/main.ts",

View File

@@ -1,10 +1,17 @@
import { debug, getState, setFailed } from '@actions/core'
import { setupKubeconfig } from 'login'
import { installKubectl } from 'setup'
import { teardown } from 'teardown'
const post = Boolean(getState('isPost'))
if (!post) {
if (getState('kubectl-path')) {
debug('Running post kubectl-action setup')
teardown()
// eslint-disable-next-line unicorn/prefer-top-level-await
.catch(error => {
setFailed('Failed to install kubectl (this is a bug in kubectl-action): ')
debug(JSON.stringify(error))
})
} else {
debug('Running kubectl-action setup')
// eslint-disable-next-line no-async-promise-executor
new Promise(async () => {