Skip to content

Commit 5d5d719

Browse files
setchyadufr
authored andcommitted
feat: add support for WorkflowRun subject (gitify-app#820)
* feat: add support for `WorkflowRun` notification subject * feat: add support for `WorkflowRun` notification subject
1 parent 671b255 commit 5d5d719

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/typesGithub.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ export type SubjectType =
2323
| 'PullRequest'
2424
| 'Release'
2525
| 'RepositoryInvitation'
26-
| 'RepositoryVulnerabilityAlert';
26+
| 'RepositoryVulnerabilityAlert'
27+
| 'WorkflowRun';
2728

2829
export type IssueStateType =
2930
| 'closed'

src/utils/github-api.test.ts

+7
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@ describe('getNotificationTypeIcon', () => {
153153
}),
154154
).displayName,
155155
).toBe('AlertIcon');
156+
expect(
157+
getNotificationTypeIcon(
158+
createSubjectMock({
159+
type: 'WorkflowRun',
160+
}),
161+
).displayName,
162+
).toBe('RocketIcon');
156163
expect(getNotificationTypeIcon(createSubjectMock({})).displayName).toBe(
157164
'QuestionIcon',
158165
);

src/utils/github-api.ts

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
MailIcon,
1515
OcticonProps,
1616
QuestionIcon,
17+
RocketIcon,
1718
SkipIcon,
1819
StopIcon,
1920
SyncIcon,
@@ -135,6 +136,8 @@ export function getNotificationTypeIcon(
135136
return MailIcon;
136137
case 'RepositoryVulnerabilityAlert':
137138
return AlertIcon;
139+
case 'WorkflowRun':
140+
return RocketIcon;
138141
default:
139142
return QuestionIcon;
140143
}

0 commit comments

Comments
 (0)