Update main

This commit is contained in:
Nick Cipollo
2019-08-27 09:40:03 -04:00
parent ef24c2a7b5
commit 0280874154

View File

@@ -1,25 +1,25 @@
import * as github from '@actions/github'; import * as github from '@actions/github';
import * as core from '@actions/core'; import * as core from '@actions/core';
import { Inputs, CoreInputs } from './Inputs'; import { CoreInputs } from './Inputs';
import { Releases, GithubReleases } from './Releases'; import { GithubReleases } from './Releases';
import { Action } from './Action';
async function run() { async function run() {
try { try {
const token = core.getInput('token'); const action = createAction()
const context = github.context await action.perform()
const git = new github.GitHub(token);
const releases = new GithubReleases(context, git)
const inputs = new CoreInputs(context)
await releases.create(inputs.tag)
.catch(error => {
core.warning(error)
})
.then(response => {
core.warning(`response: ${response}`)
})
} catch (error) { } catch (error) {
core.setFailed(error.message); core.setFailed(error.message);
} }
} }
function createAction(): Action {
const token = core.getInput('token')
const context = github.context
const git = new github.GitHub(token)
const releases = new GithubReleases(context, git)
const inputs = new CoreInputs(context)
return new Action(inputs, releases)
}
run(); run();