feat: actually execute post action
This commit is contained in:
13
src/main.ts
13
src/main.ts
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user