99 Notification ,
1010 PullRequest ,
1111 PullRequestStateType ,
12+ ReleaseComments ,
1213 User ,
1314 WorkflowRunAttributes ,
1415} from '../typesGithub' ;
@@ -27,6 +28,8 @@ export async function getGitifySubjectDetails(
2728 return await getGitifySubjectForIssue ( notification , token ) ;
2829 case 'PullRequest' :
2930 return await getGitifySubjectForPullRequest ( notification , token ) ;
31+ case 'Release' :
32+ return await getGitifySubjectForRelease ( notification , token ) ;
3033 case 'WorkflowRun' :
3134 return getGitifySubjectForWorkflowRun ( notification ) ;
3235 default :
@@ -156,6 +159,18 @@ async function getGitifySubjectForPullRequest(
156159 } ;
157160}
158161
162+ async function getGitifySubjectForRelease (
163+ notification : Notification ,
164+ token : string ,
165+ ) : Promise < GitifySubject > {
166+ const releaseCommentUser = await getLatestCommentUser ( notification , token ) ;
167+
168+ return {
169+ state : null ,
170+ user : releaseCommentUser . login ,
171+ } ;
172+ }
173+
159174function getGitifySubjectForWorkflowRun (
160175 notification : Notification ,
161176) : GitifySubject {
@@ -203,9 +218,11 @@ async function getLatestCommentUser(
203218 notification : Notification ,
204219 token : string ,
205220) : Promise < User > {
206- const response : IssueComments = (
221+ const response : IssueComments | ReleaseComments = (
207222 await apiRequestAuth ( notification . subject . latest_comment_url , 'GET' , token )
208223 ) . data ;
209224
210- return response . user ;
225+ return (
226+ ( response as IssueComments ) . user ?? ( response as ReleaseComments ) . author
227+ ) ;
211228}
0 commit comments