Add Releases
This commit is contained in:
@@ -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
24
src/releases.ts
Normal 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"
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user