Skip to content

Commit

Permalink
feat: actually execute post action
Browse files Browse the repository at this point in the history
  • Loading branch information
tale committed Jan 25, 2023
1 parent 4933a15 commit ff8bf47
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -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 () => {
Expand Down

0 comments on commit ff8bf47

Please sign in to comment.