Add Releases

This commit is contained in:
Nick Cipollo
2019-08-23 14:15:02 -04:00
parent 54146e3521
commit a3db39da9a
4 changed files with 200 additions and 1 deletions

View File

@@ -1,7 +1,14 @@
import * as github from '@actions/github';
import * as core from '@actions/core';
import { Releases } from './releases';
async function run() {
try {
const token = core.getInput('token');
const context = github.context
const git = new github.GitHub(token);
const release = new Releases(context, git)
const myInput = core.getInput('token');
core.debug(`Token ${myInput}`);
} catch (error) {

24
src/releases.ts Normal file
View File

@@ -0,0 +1,24 @@
import { Context } from "@actions/github/lib/context";
import { GitHub } from "@actions/github";
import { Response, ReposCreateReleaseResponse } from "@octokit/rest";
export class Releases {
context: Context;
git: GitHub;
constructor(context: Context, git: GitHub) {
this.context = context;
this.git = git;
}
create(): Promise<Response<ReposCreateReleaseResponse>> {
this.context.ref
return this.git.repos.createRelease({
name: "Test release",
draft: true,
owner :this.context.repo.owner,
repo: this.context.repo.owner,
tag_name: "0.0.666"
})
}
}