mirror of
https://github.com/werf/actions.git
synced 2026-02-05 02:46:23 +03:00
Add dismiss action
This commit is contained in:
35
src/dismiss.ts
Normal file
35
src/dismiss.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import * as core from '@actions/core'
|
||||
import {Manager} from './manager'
|
||||
import {
|
||||
ProcessGitHubContext,
|
||||
SetupKubeConfig,
|
||||
ValidateWerfVersion
|
||||
} from './common'
|
||||
|
||||
async function run(): Promise<void> {
|
||||
try {
|
||||
ProcessGitHubContext()
|
||||
|
||||
const kubeConfigBase64Data = core.getInput('kube-config-base64-data')
|
||||
if (kubeConfigBase64Data !== '') {
|
||||
SetupKubeConfig(kubeConfigBase64Data)
|
||||
}
|
||||
|
||||
const m = new Manager()
|
||||
await m.Install()
|
||||
|
||||
const versionOutput = await m.GetOutput(['version'])
|
||||
ValidateWerfVersion(versionOutput)
|
||||
|
||||
process.env.GITHUB_TOKEN =
|
||||
process.env.GITHUB_TOKEN || core.getInput('github-token')
|
||||
await m.PerformCIEnv()
|
||||
|
||||
process.env.WERF_ENV = core.getInput('env')
|
||||
await m.Exec(['dismiss'])
|
||||
} catch (error) {
|
||||
core.setFailed(error.message)
|
||||
}
|
||||
}
|
||||
|
||||
run()
|
||||
Reference in New Issue
Block a user