Update main
This commit is contained in:
28
src/Main.ts
28
src/Main.ts
@@ -1,25 +1,25 @@
|
||||
import * as github from '@actions/github';
|
||||
import * as core from '@actions/core';
|
||||
import { Inputs, CoreInputs } from './Inputs';
|
||||
import { Releases, GithubReleases } from './Releases';
|
||||
import { CoreInputs } from './Inputs';
|
||||
import { GithubReleases } from './Releases';
|
||||
import { Action } from './Action';
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
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)
|
||||
await releases.create(inputs.tag)
|
||||
.catch(error => {
|
||||
core.warning(error)
|
||||
})
|
||||
.then(response => {
|
||||
core.warning(`response: ${response}`)
|
||||
})
|
||||
const action = createAction()
|
||||
await action.perform()
|
||||
} catch (error) {
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user