@@ -1,7 +1,7 @@
|
||||
import { GitHub } from "@actions/github/lib/utils"
|
||||
import { OctokitResponse } from "@octokit/types"
|
||||
import { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods"
|
||||
import { Inputs } from "./Inputs"
|
||||
import type { GitHub } from "@actions/github/lib/utils"
|
||||
import type { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods"
|
||||
import type { OctokitResponse } from "@octokit/types"
|
||||
import type { Inputs } from "./Inputs"
|
||||
|
||||
export type CreateReleaseResponse = RestEndpointMethodTypes["repos"]["createRelease"]["response"]
|
||||
export type ReleaseByTagResponse = RestEndpointMethodTypes["repos"]["getReleaseByTag"]["response"]
|
||||
@@ -10,6 +10,7 @@ export type ListReleaseAssetsResponseData = RestEndpointMethodTypes["repos"]["li
|
||||
export type UpdateReleaseResponse = RestEndpointMethodTypes["repos"]["updateRelease"]["response"]
|
||||
export type UploadArtifactResponse = RestEndpointMethodTypes["repos"]["uploadReleaseAsset"]["response"]
|
||||
export type CreateOrUpdateReleaseResponse = CreateReleaseResponse | UpdateReleaseResponse
|
||||
export type GenerateReleaseNotesResponse = RestEndpointMethodTypes["repos"]["generateReleaseNotes"]["response"]
|
||||
|
||||
export type ReleaseData = {
|
||||
id: number
|
||||
@@ -34,6 +35,8 @@ export interface Releases {
|
||||
|
||||
getByTag(tag: string): Promise<ReleaseByTagResponse>
|
||||
|
||||
generateReleaseNotes(tag: string): Promise<GenerateReleaseNotesResponse>
|
||||
|
||||
listArtifactsForRelease(releaseId: number): Promise<ListReleaseAssetsResponseData>
|
||||
|
||||
listReleases(): Promise<ListReleasesResponse>
|
||||
@@ -104,6 +107,14 @@ export class GithubReleases implements Releases {
|
||||
})
|
||||
}
|
||||
|
||||
async generateReleaseNotes(tag: string): Promise<GenerateReleaseNotesResponse> {
|
||||
return this.git.rest.repos.generateReleaseNotes({
|
||||
owner: this.inputs.owner,
|
||||
repo: this.inputs.repo,
|
||||
tag_name: tag,
|
||||
})
|
||||
}
|
||||
|
||||
async getByTag(tag: string): Promise<ReleaseByTagResponse> {
|
||||
return this.git.rest.repos.getReleaseByTag({
|
||||
owner: this.inputs.owner,
|
||||
|
||||
Reference in New Issue
Block a user