-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.js
32 lines (27 loc) · 1.25 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const core = require('@actions/core')
const config = require('./action/config')
const { assertActionInput, resolveActionInput } = require('./action/utils')
const { predeploy } = require('./action/predeploy')
async function run() {
try {
const yamlFile = config.loadConfig()
assertActionInput('lightstep_api_key')
assertActionInput('lightstep_organization', yamlFile)
assertActionInput('lightstep_project', yamlFile)
const lightstepOrg = resolveActionInput('lightstep_organization', yamlFile)
const lightstepProj = resolveActionInput('lightstep_project', yamlFile)
const lightstepToken = resolveActionInput('lightstep_api_key')
core.info(`Using Lightstep organization: ${lightstepOrg}`)
core.info(`Using Lightstep project: ${lightstepProj}`)
const isRollup = resolveActionInput('rollup_conditions') === 'true'
if (isRollup) {
core.info('Rolling up conditions in table...')
}
await predeploy({ lightstepOrg, lightstepProj, lightstepToken, yamlFile, isRollup })
core.setOutput('lightstep_organization', lightstepOrg)
core.setOutput('lightstep_project', lightstepProj)
} catch (error) {
core.setFailed(error.message)
}
}
run()