From 7a723574c05595cdf0a0d91c27fe5549d76f155c Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Fri, 23 Feb 2024 16:50:13 -0400 Subject: [PATCH 1/2] feat: add support for `WorkflowRun` notification subject --- src/typesGithub.ts | 3 ++- src/utils/github-api.ts | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/typesGithub.ts b/src/typesGithub.ts index 0f6a087e6..340ec9a37 100644 --- a/src/typesGithub.ts +++ b/src/typesGithub.ts @@ -22,7 +22,8 @@ export type SubjectType = | 'PullRequest' | 'Release' | 'RepositoryInvitation' - | 'RepositoryVulnerabilityAlert'; + | 'RepositoryVulnerabilityAlert' + | 'WorkflowRun'; export type IssueStateType = | 'closed' diff --git a/src/utils/github-api.ts b/src/utils/github-api.ts index eff854549..344bae4ef 100644 --- a/src/utils/github-api.ts +++ b/src/utils/github-api.ts @@ -14,6 +14,7 @@ import { MailIcon, OcticonProps, QuestionIcon, + RocketIcon, SkipIcon, StopIcon, SyncIcon, @@ -132,6 +133,8 @@ export function getNotificationTypeIcon( return MailIcon; case 'RepositoryVulnerabilityAlert': return AlertIcon; + case 'WorkflowRun': + return RocketIcon; default: return QuestionIcon; } From 71e02ebd815493a1a23669936cbaee171ac4242c Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Fri, 23 Feb 2024 16:53:54 -0400 Subject: [PATCH 2/2] feat: add support for `WorkflowRun` notification subject --- src/utils/github-api.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/utils/github-api.test.ts b/src/utils/github-api.test.ts index e9cc4d756..5193e5291 100644 --- a/src/utils/github-api.test.ts +++ b/src/utils/github-api.test.ts @@ -152,6 +152,13 @@ describe('getNotificationTypeIcon', () => { }), ).displayName, ).toBe('AlertIcon'); + expect( + getNotificationTypeIcon( + createSubjectMock({ + type: 'WorkflowRun', + }), + ).displayName, + ).toBe('RocketIcon'); expect(getNotificationTypeIcon(createSubjectMock({})).displayName).toBe( 'QuestionIcon', );