Skip to content

Commit 6873193

Browse files
authored
Merge pull request #398 from codebytere/add-ci-activity
fix: add 'ci_activity' information to UI
2 parents dcd928c + 1b81972 commit 6873193

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/js/utils/github-api.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const DESCRIPTIONS = {
1313
STATE_CHANGE: 'You changed the thread state (for example, closing an issue or merging a pull request).',
1414
SUBSCRIBED: "You're watching the repository.",
1515
TEAM_MENTION: 'You were on a team that was mentioned.',
16+
CI_ACTIVITY: 'A GitHub Actions workflow run was triggered for your repository',
1617
UNKNOWN: 'The reason for this notification is not supported by the app.',
1718
};
1819

@@ -43,6 +44,8 @@ export function formatReason(
4344
return { type: 'Subscribed', description: DESCRIPTIONS['SUBSCRIBED'] };
4445
case 'team_mention':
4546
return { type: 'Team Mention', description: DESCRIPTIONS['TEAM_MENTION'] };
47+
case 'ci_activity':
48+
return { type: 'Workflow Run', description: DESCRIPTIONS['WORKFLOW_RUN'] };
4649
default:
4750
return { type: 'Unknown', description: DESCRIPTIONS['UNKNOWN'] };
4851
}
@@ -60,6 +63,8 @@ export function getNotificationTypeIcon(type: SubjectType): string {
6063
return 'tag';
6164
case 'RepositoryVulnerabilityAlert':
6265
return 'alert';
66+
case 'CheckSuite':
67+
return 'sync';
6368
default:
6469
return 'question';
6570
}

src/types/github.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ export type Reason =
99
| 'security_alert'
1010
| 'state_change'
1111
| 'subscribed'
12-
| 'team_mention';
12+
| 'team_mention'
13+
| 'ci_activity';
1314

1415
export type SubjectType =
1516
| 'Issue'
1617
| 'PullRequest'
1718
| 'Commit'
1819
| 'Release'
20+
| 'CheckSuite'
1921
| 'RepositoryVulnerabilityAlert';
2022

2123
export interface Notification {
@@ -102,7 +104,7 @@ export interface Owner {
102104

103105
export interface Subject {
104106
title: string;
105-
url: string;
106-
latest_comment_url: string;
107+
url?: string;
108+
latest_comment_url?: string;
107109
type: SubjectType;
108110
}

0 commit comments

Comments
 (0)