Fixes #8 Add support for draft release updating
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Context } from "@actions/github/lib/context";
|
||||
import { GitHub } from "@actions/github";
|
||||
import { AnyResponse, Response, ReposCreateReleaseResponse, ReposGetReleaseByTagResponse } from "@octokit/rest";
|
||||
import { AnyResponse, Response, ReposCreateReleaseResponse, ReposGetReleaseByTagResponse, ReposListReleasesResponse } from "@octokit/rest";
|
||||
|
||||
export interface Releases {
|
||||
create(
|
||||
@@ -14,6 +14,8 @@ export interface Releases {
|
||||
|
||||
getByTag(tag: string): Promise<Response<ReposGetReleaseByTagResponse>>
|
||||
|
||||
listReleases(): Promise<Response<ReposListReleasesResponse>>
|
||||
|
||||
update(
|
||||
id: number,
|
||||
tag: string,
|
||||
@@ -62,6 +64,13 @@ export class GithubReleases implements Releases {
|
||||
})
|
||||
}
|
||||
|
||||
async listReleases(): Promise<Response<ReposListReleasesResponse>> {
|
||||
return this.git.repos.listReleases({
|
||||
owner: this.context.repo.owner,
|
||||
repo: this.context.repo.repo
|
||||
})
|
||||
}
|
||||
|
||||
async getByTag(tag: string): Promise<Response<ReposGetReleaseByTagResponse>> {
|
||||
return this.git.repos.getReleaseByTag({
|
||||
owner: this.context.repo.owner,
|
||||
|
||||
Reference in New Issue
Block a user