From 5a95e809a172b0ac252af8dded6422600af15836 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Fri, 20 Aug 2021 23:28:24 +0800 Subject: [PATCH] :alembic: add deployed event Fix QQ-GITHUB-BOT-1V --- src/libs/github/models/issue.py | 14 +++---- src/libs/github/models/timeline.py | 14 ++++++- .../github/libs/issue/templates/deployed.html | 40 +++++++++++++++++++ .../github/libs/issue/templates/issue.html | 5 ++- 4 files changed, 64 insertions(+), 9 deletions(-) create mode 100644 src/plugins/github/libs/issue/templates/deployed.html diff --git a/src/libs/github/models/issue.py b/src/libs/github/models/issue.py index 1d87ba2..855395f 100644 --- a/src/libs/github/models/issue.py +++ b/src/libs/github/models/issue.py @@ -4,7 +4,7 @@ @Author : yanyongyu @Date : 2021-03-11 16:57:04 @LastEditors : yanyongyu -@LastEditTime : 2021-08-20 01:11:35 +@LastEditTime : 2021-08-20 23:24:08 @Description : None @GitHub : https://github.com/yanyongyu """ @@ -27,10 +27,10 @@ from .timeline import ( TimelineEventSubscribed, TimelineEventUnsubscribed, TimelineEventReviewed, TimelineEventReviewRequested, TimelineEventReviewRemoved, TimelineEventReviewDismissed, TimelineEventRenamed, TimelineEventLabeled, - TimelineEventUnlabeled, TimelineEventMerged, TimelineEventClosed, - TimelineEventAddedToProject, TimelineEventMovedColumnsInProject, - TimelineEventRemovedFromProject, TimelineEventMilestoned, - TimelineEventDemilestoned) + TimelineEventUnlabeled, TimelineEventMerged, TimelineEventDeployed, + TimelineEventClosed, TimelineEventAddedToProject, + TimelineEventMovedColumnsInProject, TimelineEventRemovedFromProject, + TimelineEventMilestoned, TimelineEventDemilestoned) class IssuePullRequest(_BaseModel): @@ -107,8 +107,8 @@ class Issue(BaseModel): TimelineEventReviewRequested, TimelineEventReviewRemoved, TimelineEventReviewDismissed, TimelineEventRenamed, TimelineEventLabeled, TimelineEventUnlabeled, - TimelineEventMerged, TimelineEventClosed, - TimelineEventAddedToProject, + TimelineEventMerged, TimelineEventDeployed, + TimelineEventClosed, TimelineEventAddedToProject, TimelineEventMovedColumnsInProject, TimelineEventRemovedFromProject, TimelineEventMilestoned, TimelineEventDemilestoned, TimelineEvent], diff --git a/src/libs/github/models/timeline.py b/src/libs/github/models/timeline.py index 249c94b..fe959dd 100644 --- a/src/libs/github/models/timeline.py +++ b/src/libs/github/models/timeline.py @@ -4,7 +4,7 @@ @Author : yanyongyu @Date : 2021-05-14 00:57:33 @LastEditors : yanyongyu -@LastEditTime : 2021-08-20 01:15:57 +@LastEditTime : 2021-08-20 23:23:33 @Description : None @GitHub : https://github.com/yanyongyu """ @@ -301,6 +301,18 @@ class TimelineEventMerged(TimelineEvent): created_at: datetime +# Pull Request Deployed +class TimelineEventDeployed(TimelineEvent): + type: Literal["deployed"] + id: int + node_id: str + url: str + actor: Actor + commit_id: Optional[str] + commit_url: Optional[str] + created_at: datetime + + # Issue Closed class TimelineEventClosed(TimelineEvent): event: Literal["closed"] diff --git a/src/plugins/github/libs/issue/templates/deployed.html b/src/plugins/github/libs/issue/templates/deployed.html new file mode 100644 index 0000000..ee6a53a --- /dev/null +++ b/src/plugins/github/libs/issue/templates/deployed.html @@ -0,0 +1,40 @@ + + +
+
+ +
+ +
diff --git a/src/plugins/github/libs/issue/templates/issue.html b/src/plugins/github/libs/issue/templates/issue.html index d73d8e1..0beb683 100644 --- a/src/plugins/github/libs/issue/templates/issue.html +++ b/src/plugins/github/libs/issue/templates/issue.html @@ -2,7 +2,7 @@ * @Author : yanyongyu * @Date : 2021-05-14 17:11:26 * @LastEditors : yanyongyu - * @LastEditTime : 2021-08-20 00:53:29 + * @LastEditTime : 2021-08-20 23:25:47 * @Description : None * @GitHub : https://github.com/yanyongyu --> @@ -69,6 +69,9 @@ {% elif event|classname == "TimelineEventUnlabeled" -%} {% include "unlabel.html" %} + {% elif event|classname == "TimelineEventDeployed" -%} + {% include "deployed.html" %} + {% elif event|classname == "TimelineEventAddedToProject" -%} {% include "add-to-project.html" %}