Fixes #593 Pass commitish into release notes request when present (#594)

This commit is contained in:
Nick Cipollo
2026-03-04 22:51:50 -05:00
committed by GitHub
parent 9e0366240f
commit c074b5e19f
6 changed files with 33 additions and 8268 deletions

View File

@@ -197,7 +197,7 @@ export class Action {
return body
}
const response = await this.releases.generateReleaseNotes(this.inputs.tag, this.inputs.generateReleaseNotesPreviousTag)
const response = await this.releases.generateReleaseNotes(this.inputs.tag, this.inputs.generateReleaseNotesPreviousTag, this.inputs.commit)
const releaseNotes = response.data.body
if (!body || body.trim() === "") {

View File

@@ -36,7 +36,7 @@ export interface Releases {
getByTag(tag: string): Promise<ReleaseByTagResponse>
generateReleaseNotes(tag: string, previousTag?: string): Promise<GenerateReleaseNotesResponse>
generateReleaseNotes(tag: string, previousTag?: string, targetCommitish?: string): Promise<GenerateReleaseNotesResponse>
listArtifactsForRelease(releaseId: number): Promise<ListReleaseAssetsResponseData>
@@ -106,17 +106,21 @@ export class GithubReleases implements Releases {
})
}
async generateReleaseNotes(tag: string, previousTag?: string): Promise<GenerateReleaseNotesResponse> {
async generateReleaseNotes(tag: string, previousTag?: string, targetCommitish?: string): Promise<GenerateReleaseNotesResponse> {
const params: any = {
owner: this.inputs.owner,
repo: this.inputs.repo,
tag_name: tag,
}
if (previousTag) {
params.previous_tag_name = previousTag
}
if (targetCommitish) {
params.target_commitish = targetCommitish
}
return this.git.rest.repos.generateReleaseNotes(params)
}