Skip to content

Commit 04946f4

Browse files
authored
Merge pull request #374 from manosim/support-reason-vulnerability
Notification Icon - Support "Vulnerability alerts"
2 parents 58a8406 + b5e6ee9 commit 04946f4

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/js/utils/github-api.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ describe('./utils/github-api.ts', () => {
2222
expect(getNotificationTypeIcon('PullRequest')).toBe('git-pull-request');
2323
expect(getNotificationTypeIcon('Commit')).toBe('git-commit');
2424
expect(getNotificationTypeIcon('Release')).toBe('tag');
25+
expect(getNotificationTypeIcon('RepositoryVulnerabilityAlert')).toBe(
26+
'alert'
27+
);
2528
expect(getNotificationTypeIcon('Unknown' as SubjectType)).toBe('question');
2629
});
2730
});

src/js/utils/github-api.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ export function getNotificationTypeIcon(type: SubjectType): string {
5858
return 'git-commit';
5959
case 'Release':
6060
return 'tag';
61+
case 'RepositoryVulnerabilityAlert':
62+
return 'alert';
6163
default:
6264
return 'question';
6365
}

src/types/github.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ export type Reason =
1111
| 'subscribed'
1212
| 'team_mention';
1313

14-
export type SubjectType = 'Issue' | 'PullRequest' | 'Commit' | 'Release';
14+
export type SubjectType =
15+
| 'Issue'
16+
| 'PullRequest'
17+
| 'Commit'
18+
| 'Release'
19+
| 'RepositoryVulnerabilityAlert';
1520

1621
export interface Notification {
1722
id: string;

0 commit comments

Comments
 (0)