Throw explicit error if list releases reponse doesn't have data

This commit is contained in:
Nick Cipollo
2025-01-11 21:52:42 -05:00
parent e774b3eb81
commit 033b82b409
4 changed files with 35 additions and 2 deletions

View File

@@ -120,6 +120,10 @@ export class Action {
const tag = this.inputs.tag
const response = await this.releases.listReleases()
const releases = response.data
if(!releases) {
throw new Error(`No releases found. Response: ${JSON.stringify(response)}`)
}
const draftRelease = releases.find(release => release.draft && release.tag_name == tag)
return draftRelease?.id